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

[operations] CODEGEN-784 - Fix Apollo @unmask fragmentRefs #10302

Merged
merged 5 commits into from
Feb 23, 2025

Conversation

eddeee888
Copy link
Collaborator

@eddeee888 eddeee888 commented Feb 20, 2025

Description

When using Apollo masking features, an @unmask fragment is the same as inlined i.e.

  • should not have $fragmentRefs
  • selection node fields are inlined

Reference: #10299

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Unit test

Copy link

changeset-bot bot commented Feb 20, 2025

🦋 Changeset detected

Latest commit: 5ef68e7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@graphql-codegen/visitor-plugin-common Patch
@graphql-codegen/typescript-operations Patch
@graphql-codegen/client-preset Patch
@graphql-codegen/typescript-document-nodes Patch
@graphql-codegen/gql-tag-operations Patch
@graphql-codegen/typescript-resolvers Patch
@graphql-codegen/typed-document-node Patch
@graphql-codegen/typescript Patch
@graphql-codegen/graphql-modules-preset Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Feb 20, 2025

💻 Website Preview

The latest changes are available as preview in: https://76ad1af2.graphql-code-generator.pages.dev

Copy link
Contributor

github-actions bot commented Feb 21, 2025

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-codegen/visitor-plugin-common 5.7.1-alpha-20250221122145-5ef68e775c396313780244f87714d33191a46522 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-document-nodes 4.0.15-alpha-20250221122145-5ef68e775c396313780244f87714d33191a46522 npm ↗︎ unpkg ↗︎
@graphql-codegen/gql-tag-operations 4.0.16-alpha-20250221122145-5ef68e775c396313780244f87714d33191a46522 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-operations 4.5.1-alpha-20250221122145-5ef68e775c396313780244f87714d33191a46522 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-resolvers 4.4.4-alpha-20250221122145-5ef68e775c396313780244f87714d33191a46522 npm ↗︎ unpkg ↗︎
@graphql-codegen/typed-document-node 5.0.15-alpha-20250221122145-5ef68e775c396313780244f87714d33191a46522 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript 4.1.5-alpha-20250221122145-5ef68e775c396313780244f87714d33191a46522 npm ↗︎ unpkg ↗︎
@graphql-codegen/client-preset 4.6.4-alpha-20250221122145-5ef68e775c396313780244f87714d33191a46522 npm ↗︎ unpkg ↗︎
@graphql-codegen/graphql-modules-preset 4.0.15-alpha-20250221122145-5ef68e775c396313780244f87714d33191a46522 npm ↗︎ unpkg ↗︎

@eddeee888 eddeee888 marked this pull request as ready for review February 21, 2025 12:34
@@ -548,6 +548,7 @@ export class SelectionSetToObject<Config extends ParsedDocumentsConfig = ParsedD
selectionNodes = [...selectionNodes];
let inlineFragmentConditional = false;
for (const selectionNode of selectionNodes) {
// 1. Handle Field or Directtives selection nodes
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 1. Handle Field or Directtives selection nodes
// 1. Handle Field or Directives selection nodes

Noticed a small typo 🙂

Copy link
Contributor

@jerelmiller jerelmiller left a comment

Choose a reason for hiding this comment

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

I know my approval doesn't mean much here, but this looks right to me. Thanks so much for helping out! Much simpler than I realized this would be 🙌

@eddeee888 eddeee888 merged commit d8566c0 into master Feb 23, 2025
20 checks passed
@eddeee888 eddeee888 deleted the fix-unmask-fragmentrefi branch February 23, 2025 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants