You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Align codegen and language server inline fragment __typename use
The `withTypenameFieldAddedWhereNeeded` utility in `apollo-language-server`
was updated in #1286 to make sure `__typename`'s are added to inline
fragments, when used by commands like `client:push`. The
`apollo-codegen-core` package currently uses its own copy of
`withTypenameFieldAddedWhereNeeded` however, which was not updated. This
means that operations can be registered (in Apollo's operation registry)
via `client:push` that don't line up with the operations output by codegen.
This commit adjusts the `apollo-codegen-core` package to use the same
`withTypenameFieldAddedWhereNeeded` function as `apollo-language-server`
(which is already a dependency of codegen), to make sure the operations
output from codegen line up with the operations pushed via
`client:push`.
- Preserve directive usages on SchemaDefinition nodes in `buildSchemaFromSDL`[PR #2457](https://github.com/apollographql/apollo-tooling/pull/2457)
10
10
11
+
-`apollo-language-server` / `apollo-codegen-core`
12
+
- Adjust `apollo-codegen-core` to use the same `withTypenameFieldAddedWhereNeeded` utility as `apollo-language-server`, to make sure modified operations align between codegen and anything leveraging the language server utility functions (like the `client:push` command). <br/>
13
+
[@hwillson](https://github.com/hwillson) in [#TODO]()
@@ -215,7 +215,7 @@ exports[`JSON output should generate JSON output for a query with a fragment spr
215
215
],
216
216
\\"fragmentName\\": \\"CharacterDetails\\",
217
217
\\"filePath\\": \\"GraphQL request\\",
218
-
\\"source\\": \\"fragment CharacterDetails on Character {\\\\n __typename\\\\n name\\\\n ... on Droid {\\\\n primaryFunction\\\\n }\\\\n ... on Human {\\\\n height\\\\n }\\\\n}\\",
218
+
\\"source\\": \\"fragment CharacterDetails on Character {\\\\n __typename\\\\n name\\\\n ... on Droid {\\\\n __typename\\\\n primaryFunction\\\\n }\\\\n ... on Human {\\\\n __typename\\\\n height\\\\n }\\\\n}\\",
219
219
\\"fields\\": [
220
220
{
221
221
\\"responseName\\": \\"__typename\\",
@@ -707,7 +707,7 @@ exports[`JSON output should list all interfaces and their implementing types und
0 commit comments