Skip to content

Commit 6c9f0df

Browse files
upgrade to graphql v17 including support for new incremental delivery format (#3682)
* add support for new incremental delivery format * fix vitest * add patch for graphql-js bug submittes upstream with test at graphql/graphql-js#4160 * apply feedback * move patches! * some fixes * fix netlify/cypress * remove export * update changeset --------- Co-authored-by: Dimitri POSTOLOV <[email protected]>
1 parent 1c1d2b5 commit 6c9f0df

File tree

34 files changed

+407
-230
lines changed

34 files changed

+407
-230
lines changed

.changeset/wild-frogs-invite.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'graphql-language-service-server': minor
3+
'@graphiql/plugin-code-exporter': minor
4+
'graphql-language-service-cli': minor
5+
'@graphiql/plugin-explorer': minor
6+
'graphql-language-service': minor
7+
'vscode-graphql-execution': minor
8+
'codemirror-graphql': minor
9+
'@graphiql/toolkit': minor
10+
'@graphiql/react': minor
11+
'monaco-graphql': minor
12+
'vscode-graphql': minor
13+
'cm6-graphql': minor
14+
'graphiql': minor
15+
---
16+
17+
Support v17 of `graphql-js` from `17.0.0-alpha.2` forward.
18+
19+
Includes support for the latest incremental delivery response format. For further details, see https://github.com/graphql/defer-stream-wg/discussions/69.

.github/workflows/pr-graphql-compat-check.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ jobs:
2323
runs-on: ubuntu-20.04
2424
strategy:
2525
matrix:
26-
release: ['15.5.3', '^15.8.0', '16.1.0', '16.2.0', '16.3.0']
26+
release:
27+
['15.5.3', '^15.8.0', '16.1.0', '16.2.0', '16.3.0', '17.0.0-alpha.5']
2728
steps:
2829
- name: Checkout Code
2930
uses: actions/checkout@v4

functions/graphql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function createHandler<Context extends OperationContext = undefined>(
4545
statusCode: init.status,
4646
};
4747
} catch (err) {
48-
// The handler should'nt throw errors.
48+
// The handler shouldn't throw errors.
4949
// If you wish to handle them differently, consider implementing your own request handler.
5050
console.error(
5151
'Internal error occurred during request handling. ' +

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"gen-agenda": "wgutils agenda gen"
7979
},
8080
"dependencies": {
81+
"graphql-http": "^1.22.1",
8182
"@babel/cli": "^7.21.0",
8283
"@babel/core": "^7.21.0",
8384
"@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -143,6 +144,7 @@
143144
"resolutions": {
144145
"@babel/traverse": "^7.23.2",
145146
"vscode-languageserver-types": "3.17.3",
146-
"markdown-it": "14.1.0"
147+
"markdown-it": "14.1.0",
148+
"graphql": "17.0.0-alpha.5"
147149
}
148150
}

packages/cm6-graphql/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@lezer/highlight": "^1.0.0",
3131
"@lezer/lr": "^1.1.0",
3232
"esbuild": "0.18.10",
33-
"graphql": "^16.8.1",
33+
"graphql": "^17.0.0-alpha.5",
3434
"rollup": "^2.60.2",
3535
"rollup-plugin-dts": "^4.0.1",
3636
"rollup-plugin-esbuild": "^4.9.1",
@@ -44,7 +44,7 @@
4444
"@codemirror/state": "6.2.0",
4545
"@codemirror/view": "6.2.1",
4646
"@lezer/highlight": "^1.0.0",
47-
"graphql": "^16.5.0"
47+
"graphql": "^16.5.0 || ^17.0.0-alpha.2"
4848
},
4949
"license": "MIT"
5050
}

packages/codemirror-graphql/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"peerDependencies": {
4141
"@codemirror/language": "6.0.0",
4242
"codemirror": "^5.65.3",
43-
"graphql": "^15.5.0 || ^16.0.0"
43+
"graphql": "^15.5.0 || ^16.0.0 || ^17.0.0-alpha.2"
4444
},
4545
"// TEMPORARILY PINNED until we fix graphql 15 support": "",
4646
"dependencies": {
@@ -51,7 +51,7 @@
5151
"@codemirror/language": "^6.0.0",
5252
"codemirror": "^5.65.3",
5353
"cross-env": "^7.0.2",
54-
"graphql": "^16.8.1",
54+
"graphql": "^17.0.0-alpha.5",
5555
"rimraf": "^3.0.2",
5656
"sane": "2.0.0"
5757
}

packages/codemirror-graphql/src/__tests__/lint-test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import CodeMirror from 'codemirror';
1111
import 'codemirror/addon/lint/lint';
1212
import { readFileSync } from 'node:fs';
1313
import { join } from 'node:path';
14-
import { GraphQLError, OperationDefinitionNode } from 'graphql';
14+
import { GraphQLError, OperationDefinitionNode, version } from 'graphql';
1515
import '../lint';
1616
import '../mode';
1717
import { TestSchema } from './testSchema';
@@ -61,7 +61,13 @@ describe('graphql-lint', () => {
6161
const noMutationOperationRule = (context: any) => ({
6262
OperationDefinition(node: OperationDefinitionNode) {
6363
if (node.operation === 'mutation') {
64-
context.reportError(new GraphQLError('I like turtles.', node));
64+
context.reportError(
65+
new GraphQLError(
66+
'I like turtles.',
67+
// @ts-expect-error
68+
parseInt(version, 10) > 16 ? { nodes: node } : node,
69+
),
70+
);
6571
}
6672
return false;
6773
},

packages/graphiql-plugin-code-exporter/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
},
3535
"peerDependencies": {
3636
"@graphiql/react": "^0.23.0",
37-
"graphql": "^15.5.0 || ^16.0.0",
37+
"graphql": "^15.5.0 || ^16.0.0 || ^17.0.0-alpha.2",
3838
"react": "^16.8.0 || ^17 || ^18",
3939
"react-dom": "^16.8.0 || ^17 || ^18"
4040
},
4141
"devDependencies": {
4242
"@graphiql/react": "^0.23.0",
4343
"@vitejs/plugin-react": "^4.3.1",
44-
"graphql": "^16.8.1",
44+
"graphql": "^17.0.0-alpha.5",
4545
"postcss-nesting": "^10.1.7",
4646
"react": "^18.2.0",
4747
"react-dom": "^18.2.0",

packages/graphiql-plugin-explorer/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
},
3434
"peerDependencies": {
3535
"@graphiql/react": "^0.23.0",
36-
"graphql": "^15.5.0 || ^16.0.0",
36+
"graphql": "^15.5.0 || ^16.0.0 || ^17.0.0-alpha.2",
3737
"react": "^16.8.0 || ^17 || ^18",
3838
"react-dom": "^16.8.0 || ^17 || ^18"
3939
},
4040
"devDependencies": {
4141
"@graphiql/react": "^0.23.0",
4242
"@vitejs/plugin-react": "^4.3.1",
43-
"graphql": "^16.8.1",
43+
"graphql": "^17.0.0-alpha.5",
4444
"react": "^18.2.0",
4545
"react-dom": "^18.2.0",
4646
"typescript": "^4.6.3",

packages/graphiql-react/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"build": "tsc --emitDeclarationOnly && vite build"
4444
},
4545
"peerDependencies": {
46-
"graphql": "^15.5.0 || ^16.0.0",
46+
"graphql": "^15.5.0 || ^16.0.0 || ^17.0.0-alpha.2",
4747
"react": "^16.8.0 || ^17 || ^18",
4848
"react-dom": "^16.8.0 || ^17 || ^18"
4949
},
@@ -60,17 +60,19 @@
6060
"codemirror-graphql": "^2.0.13",
6161
"copy-to-clipboard": "^3.2.0",
6262
"framer-motion": "^6.5.1",
63+
"get-value": "^3.0.1",
6364
"graphql-language-service": "^5.2.2",
6465
"markdown-it": "^14.1.0",
6566
"set-value": "^4.1.0"
6667
},
6768
"devDependencies": {
68-
"@types/markdown-it": "^14.1.2",
6969
"@babel/helper-string-parser": "^7.19.4",
7070
"@testing-library/react": "14.0.0",
71+
"@types/markdown-it": "^14.1.2",
72+
"@types/get-value": "^3.0.5",
7173
"@types/set-value": "^4.0.1",
7274
"@vitejs/plugin-react": "^4.3.1",
73-
"graphql": "^16.8.1",
75+
"graphql": "^17.0.0-alpha.5",
7476
"postcss-nesting": "^10.1.7",
7577
"react": "^18.2.0",
7678
"react-dom": "^18.2.0",

0 commit comments

Comments
 (0)