Skip to content

Conversation

@ardatan
Copy link
Collaborator

@ardatan ardatan commented Nov 12, 2025

Fixes ardatan/graphql-tools#7682

Handle schema extension nodes correctly

When a schema doesn't have an operation type defined but has schema extension definitions with directives like below,
schema extensions are not converted to schema definitions by GraphQL Tools.
So the visitor should handle schema extension nodes correctly.

Follow-up to
ardatan/graphql-tools#7685

Previously this wasn't an issue because GraphQL Tools incorrectly converted extend schema to schema.

extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key"])

type Foo {
  id: ID! @key
  name: String
}

@ardatan ardatan requested a review from eddeee888 November 12, 2025 09:46
@changeset-bot
Copy link

changeset-bot bot commented Nov 12, 2025

🦋 Changeset detected

Latest commit: 9d9f634

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-document-nodes Patch
@graphql-codegen/gql-tag-operations Patch
@graphql-codegen/typescript-operations Patch
@graphql-codegen/typescript-resolvers Patch
@graphql-codegen/typed-document-node Patch
@graphql-codegen/typescript Patch
@graphql-codegen/graphql-modules-preset Patch
@graphql-codegen/client-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

@github-actions
Copy link
Contributor

🚀 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/cli 6.0.2-alpha-20251112094753-9d9f6346d64d7ab7a726ad77f9cb95ebaefbfdef npm ↗︎ unpkg ↗︎
@graphql-codegen/visitor-plugin-common 6.1.1-alpha-20251112094753-9d9f6346d64d7ab7a726ad77f9cb95ebaefbfdef npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-document-nodes 5.0.3-alpha-20251112094753-9d9f6346d64d7ab7a726ad77f9cb95ebaefbfdef npm ↗︎ unpkg ↗︎
@graphql-codegen/gql-tag-operations 5.0.4-alpha-20251112094753-9d9f6346d64d7ab7a726ad77f9cb95ebaefbfdef npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-operations 5.0.3-alpha-20251112094753-9d9f6346d64d7ab7a726ad77f9cb95ebaefbfdef npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-resolvers 5.1.1-alpha-20251112094753-9d9f6346d64d7ab7a726ad77f9cb95ebaefbfdef npm ↗︎ unpkg ↗︎
@graphql-codegen/typed-document-node 6.1.1-alpha-20251112094753-9d9f6346d64d7ab7a726ad77f9cb95ebaefbfdef npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript 5.0.3-alpha-20251112094753-9d9f6346d64d7ab7a726ad77f9cb95ebaefbfdef npm ↗︎ unpkg ↗︎
@graphql-codegen/client-preset 5.1.2-alpha-20251112094753-9d9f6346d64d7ab7a726ad77f9cb95ebaefbfdef npm ↗︎ unpkg ↗︎
@graphql-codegen/graphql-modules-preset 5.0.4-alpha-20251112094753-9d9f6346d64d7ab7a726ad77f9cb95ebaefbfdef npm ↗︎ unpkg ↗︎

Copy link
Collaborator

@eddeee888 eddeee888 left a comment

Choose a reason for hiding this comment

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

Thank you!

@eddeee888 eddeee888 merged commit 6715330 into master Nov 12, 2025
19 of 21 checks passed
@eddeee888 eddeee888 deleted the handle-schema-ext branch November 12, 2025 15:29
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.

[object Object] Rendered into codegen types

3 participants