Skip to content

feat: upgrade to GraphQL 17 - #8394

Draft
n1ru4l wants to merge 8 commits into
mainfrom
feat-graphql-17
Draft

feat: upgrade to GraphQL 17#8394
n1ru4l wants to merge 8 commits into
mainfrom
feat-graphql-17

Conversation

@n1ru4l

@n1ru4l n1ru4l commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Base automatically changed from chore-update-graphql-inspector to main August 21, 2026 18:44
Comment on lines +93 to +125
/**
* GraphQL 17 started omitting empty arrays within the Document AST.
* In order to retain the hash, we backfill these.
*/
const cacheDocumentReplacer = (_: any, value: any) => {
if (!value || typeof value !== 'object') {
return value;
}

switch (value.kind) {
case 'OperationDefinition':
return {
...value,
variableDefinitions: value.variableDefinitions ?? [],
directives: value.directives ?? [],
};
case 'VariableDefinition':
case 'FragmentSpread':
case 'InlineFragment':
case 'FragmentDefinition':
return { ...value, directives: value.directives ?? [] };
case 'Field':
return {
...value,
arguments: value.arguments ?? [],
directives: value.directives ?? [],
};
case 'Directive':
return { ...value, arguments: value.arguments ?? [] };
default:
return value;
}
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

subscription: Subscription
}

extend schema

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The extend schema @link seems to override the implicit default schema declaration in v17 for some reason 🤔
i.e. it sets the schema block as schema {}. This causes Query, Mutation and Subscription to be null.

When Codegen validates the schema on 2 generates blocks with url-introspection and typescript-operaitons plugins, it sees Query is null, so it throws Query root type must be provided.

Let me try to trace back to graphql 17 upgrade guide to see if this is expected.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be fixed @graphql-tools/merge@9.2.4 when this PR is merged: ardatan/graphql-tools#8365

@theguild-bot

theguild-bot commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

🚀 Snapshot Release (alpha)

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

Package Version Info
@graphql-hive/apollo 0.49.0-alpha-20260825074758-3078f7f081ee86dfd312794a161a36f8533d560c npm ↗︎ unpkg ↗︎
@graphql-hive/cli 0.62.1-alpha-20260825074758-3078f7f081ee86dfd312794a161a36f8533d560c npm ↗︎ unpkg ↗︎
@graphql-hive/core 0.23.0-alpha-20260825074758-3078f7f081ee86dfd312794a161a36f8533d560c npm ↗︎ unpkg ↗︎
@graphql-hive/envelop 0.41.0-alpha-20260825074758-3078f7f081ee86dfd312794a161a36f8533d560c npm ↗︎ unpkg ↗︎
@graphql-hive/external-composition 0.1.0-alpha-20260825074758-3078f7f081ee86dfd312794a161a36f8533d560c npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-plugin-console-sdk 0.2.0-alpha-20260825074758-3078f7f081ee86dfd312794a161a36f8533d560c npm ↗︎ unpkg ↗︎
@graphql-hive/yoga 0.50.0-alpha-20260825074758-3078f7f081ee86dfd312794a161a36f8533d560c npm ↗︎ unpkg ↗︎
hive 11.12.1-alpha-20260825074758-3078f7f081ee86dfd312794a161a36f8533d560c npm ↗︎ unpkg ↗︎

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tags: 11.12.1-alpha-3078f7f, 3078f7f, 3078f7f081ee86dfd312794a161a36f8533d560c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants