feat: upgrade to GraphQL 17 - #8394
Conversation
| /** | ||
| * 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; | ||
| } | ||
| }; |
There was a problem hiding this comment.
| subscription: Subscription | ||
| } | ||
|
|
||
| extend schema |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
This should be fixed @graphql-tools/merge@9.2.4 when this PR is merged: ardatan/graphql-tools#8365
🚀 Snapshot Release (
|
| 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 ↗︎ |
|
🐋 This PR was built and pushed to the following Docker images: Targets: Platforms: Image Tags: |
No description provided.