Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align codegen and language server inline fragment __typename use #2473

Merged
merged 1 commit into from
Nov 11, 2021

Conversation

hwillson
Copy link
Member

@hwillson hwillson commented Nov 9, 2021

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.

@hwillson hwillson self-assigned this Nov 9, 2021
@hwillson hwillson force-pushed the typename-fragment-issue branch 2 times, most recently from 9c414e3 to 21730c0 Compare November 9, 2021 23:35
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`.
Copy link
Member

@calvincestari calvincestari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the help in getting this fixed Hugh! 🥇

@hwillson hwillson merged commit 9eaf49e into master Nov 11, 2021
@hwillson hwillson deleted the typename-fragment-issue branch November 11, 2021 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants