-
-
Notifications
You must be signed in to change notification settings - Fork 569
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
GraphQL 16 support #1583
Comments
I am getting version conflicts in my projects because I am using:
Not a rare combination probably. Some of these dependencies expect graphql v16. So I tried to solve the conflicts by:
Now I get this error when a query is executed: PostGraphile v4.12.11 server listening on port 5000 🚀
‣ GraphQL API: http://localhost:5000/graphql
‣ GraphiQL GUI/IDE: http://localhost:5000/graphiql
‣ Postgres connection: postgres://postgres:[SECRET]@localhost/ae (watching)
‣ Postgres schema(s): ae
‣ Documentation: https://graphile.org/postgraphile/introduction/
‣ Node.js version: v17.5.0 on linux x64
‣ Join Dovetail in supporting PostGraphile development: https://graphile.org/sponsor/
* * *
Error: graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.
at devAssert (/mnt/c/Users/alexa/ae2/node_modules/graphql/jsutils/devAssert.js:12:11)
at Object.execute (/mnt/c/Users/alexa/ae2/node_modules/graphql/execution/execute.js:107:30)
at /mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:718:61
at /mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:106:20
at /mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/withPostGraphileContext.js:172:30
at withAuthenticatedPgClient (/mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/withPostGraphileContext.js:112:34)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:709:34
at async Promise.all (index 0)
at async graphqlRouteHandler (/mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:641:23)
An unexpected error occurred whilst processing 'graphqlRouteHandler'; this indicates a bug. The connection will be terminated.
TypeError: Cannot set properties of undefined (setting 'statusCode')
at graphqlRouteHandler (/mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:810:39)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:347:17
Error: graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.
at devAssert (/mnt/c/Users/alexa/ae2/node_modules/graphql/jsutils/devAssert.js:12:11)
at Object.execute (/mnt/c/Users/alexa/ae2/node_modules/graphql/execution/execute.js:107:30)
at /mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:718:61
at /mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:106:20
at /mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/withPostGraphileContext.js:172:30
at withAuthenticatedPgClient (/mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/withPostGraphileContext.js:112:34)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:709:34
at async Promise.all (index 0)
at async graphqlRouteHandler (/mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:641:23)
An unexpected error occurred whilst processing 'graphqlRouteHandler'; this indicates a bug. The connection will be terminated.
TypeError: Cannot set properties of undefined (setting 'statusCode')
at graphqlRouteHandler (/mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:810:39)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /mnt/c/Users/alexa/ae2/node_modules/postgraphile/build/postgraphile/http/createPostGraphileHttpRequestHandler.js:347:17 |
I now tried overriding with graphql v15.6.1 or 15.7.2. But then data queries are simply never answered: network status remains |
I uninstalled graphql again, deleted package-lock.json, emptied node_modules, ran PS C:\Users\alexa\ae2> npm ls graphql
artdaten@1.7.21 C:\Users\alexa\ae2
├─┬ @apollo/client@3.7.1
│ ├─┬ @graphql-typed-document-node/core@3.1.1
│ │ └── graphql@16.6.0 deduped
│ ├── graphql@16.6.0
│ └─┬ subscriptions-transport-ws@0.9.19
│ └── graphql@16.6.0 deduped
├─┬ gatsby-plugin-image@3.0.0
│ └─┬ gatsby-plugin-utils@4.0.0
│ └── graphql@16.6.0 deduped
├─┬ gatsby@5.0.1
│ ├─┬ @graphql-codegen/add@3.2.1
│ │ └── graphql@16.6.0 deduped
│ ├─┬ @graphql-codegen/core@2.6.5
│ │ ├─┬ @graphql-tools/schema@9.0.9
│ │ │ ├─┬ @graphql-tools/merge@8.3.11
│ │ │ │ ├─┬ @graphql-tools/utils@9.1.0
│ │ │ │ │ └── graphql@16.6.0 deduped invalid: "^14.7.0 || ^15.3.0" from node_modules/express-graphql, ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" from node_modules/graphile-build, ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" from node_modules/postgraphile-core, ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" from node_modules/graphql-parse-resolve-info
│ │ │ │ └── graphql@16.6.0 deduped invalid: "^14.7.0 || ^15.3.0" from node_modules/express-graphql, ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" from node_modules/graphile-build, ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" from node_modules/postgraphile-core, ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" from node_modules/graphql-parse-resolve-info
│ │ │ ├─┬ @graphql-tools/utils@9.1.0
│ │ │ │ └── graphql@16.6.0 deduped invalid: "^14.7.0 || ^15.3.0" from node_modules/express-graphql, ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" from node_modules/graphile-build, ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" from node_modules/postgraphile-core, ">=0.9 ├─┬ graphile-utils@4.12.3
│ └── graphql@15.8.0
├── graphql@15.8.0
└─┬ postgraphile-core@4.12.3
└── graphql@16.6.0 deduped invalid: "^14.7.0 || ^15.3.0" from node_modules/express-graphql, ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" from node_modules/graphile-build, ">=0.9 <0.14 || ^14.0.2 || ^15.4.0" from node_modules/postgraphile-core
npm ERR! code ELSPROBLEMS
npm ERR! invalid: graphql@16.6.0 C:\Users\alexa\ae2\node_modules\graphql
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\alexa\AppData\Local\npm-cache\_logs\2022-11-13T14_17_05_936Z-debug-0.log |
Yes; this difficulty is why we’ve not managed to add v16 support on top of v0.8-v15 support; too many interfaces broke. |
If you’d like to help, please fork graphile/graphile-engine#764 and apply the relevant changes required to pass CI with both old and new GraphQL versions. |
...or revert updates in other libraries using graphql and wait for v5 of postgraphile. Which is probably what I will do. Thanks for great help and building this tool, @benjie |
In case others run into this: The conflict was caused by gatsby v5 requiring graphql v16. If you use gatsby and postgraphile, you need to stay with gatsby v4. |
In case of conflicts created by other libraries expecting graphql v16 while postgraphile expects v15: a workaround is to remove postgraphile from package.json file by either creating a new project for the backend or using docker. When postgraphile lives in it's own world no one else cares about it's graphql version 😆 |
V5 is built on top of GraphQL v16 |
Feature description
postgraphile requires
graphql
version 15 or lower. Since graphql 16 has been stable for a while, I'd love to see it being supported by postgraphile.Supporting development
I [tick all that apply]:
The text was updated successfully, but these errors were encountered: