question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple instances of graphql

See original GitHub issue

It seems the recent release of the 19th August 2022 upgraded graphql dependency to fix a security vulnerability, yet the @keystone-6/auth package did not and this now causes issues with build. To replicate… Upgrade keystone dependencies to the below as per recent release.

"@keystone-6/auth": "4.0.1",
"@keystone-6/core": "2.2.0",
"@keystone-6/document-renderer": "1.1.1",
"@keystone-6/fields-document": "4.1.0",
"@keystone-ui/fields": "7.1.1",

Try and run yarn. You will see…

Error: Cannot use GraphQLScalarType "{ name: "String", description: "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", specifiedByURL: undefined, serialize: [function serialize], parseValue: [function parseValue], parseLiteral: [function parseLiteral], extensions: {}, astNode: undefined, extensionASTNodes: [] }" from another module or realm.

Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.

https://yarnpkg.com/en/docs/selective-version-resolutions

Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
    at instanceOf (/Users/skin/Projects/activeProjects/0197_LL_SiteRebuild/lokalliving-stack/keystone6/node_modules/@keystone-6/core/node_modules/graphql/jsutils/instanceOf.js:35:13)
    ...

On inspection of the dependency tree we can see this is true.

β”œβ”€β”¬ @keystone-6/auth@4.0.1
β”‚ └── graphql@15.8.0
β”œβ”€β”¬ @keystone-6/core@2.2.0
β”‚ β”œβ”€β”¬ @apollo/client@3.6.9
β”‚ β”‚ β”œβ”€β”¬ @graphql-typed-document-node/core@3.1.1
β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ β”œβ”€β”¬ graphql-tag@2.12.6
β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ └── graphql@16.6.0
β”‚ β”œβ”€β”¬ @graphql-tools/schema@9.0.1
β”‚ β”‚ β”œβ”€β”¬ @graphql-tools/merge@8.3.3
β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ β”œβ”€β”¬ @graphql-tools/utils@8.10.0
β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”œβ”€β”¬ @graphql-ts/extend@0.4.1
β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”œβ”€β”¬ @graphql-ts/schema@0.5.3
β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”œβ”€β”¬ @types/apollo-upload-client@17.0.1
β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”œβ”€β”¬ apollo-server-core@3.10.1
β”‚ β”‚ β”œβ”€β”¬ @apollo/utils.usagereporting@1.0.0
β”‚ β”‚ β”‚ β”œβ”€β”¬ @apollo/utils.dropunuseddefinitions@1.1.0
β”‚ β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ @apollo/utils.printwithreducedwhitespace@1.1.0
β”‚ β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ @apollo/utils.removealiases@1.0.0
β”‚ β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ @apollo/utils.sortast@1.1.0
β”‚ β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ @apollo/utils.stripsensitiveliterals@1.2.0
β”‚ β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ β”œβ”€β”¬ @apollographql/apollo-tools@0.5.4
β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ β”œβ”€β”¬ @graphql-tools/mock@8.7.3
β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ β”œβ”€β”¬ @graphql-tools/schema@8.5.1
β”‚ β”‚ β”‚ β”œβ”€β”¬ @graphql-tools/merge@8.3.1
β”‚ β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ β”‚ β”œβ”€β”¬ @graphql-tools/utils@8.9.0
β”‚ β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ β”œβ”€β”¬ apollo-server-plugin-base@3.6.2
β”‚ β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”œβ”€β”¬ apollo-server-errors@3.3.1
β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”œβ”€β”¬ apollo-server-express@3.10.1
β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”œβ”€β”¬ apollo-server-types@3.6.2
β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”œβ”€β”¬ apollo-upload-client@17.0.0
β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”œβ”€β”¬ graphql-type-json@0.3.2
β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ β”œβ”€β”¬ graphql-upload@15.0.2
β”‚ β”‚ └── graphql@16.6.0 deduped
β”‚ └── graphql@15.8.0
└─┬ @keystone-6/fields-document@4.1.0
  └── graphql@15.8.0

This can be also confirmed by inspecting the source code packages/auth/package.json

It seems auth package missed the upgrade. This is actually a non issue for me as I have built my own Auth and Access extension based on the original so I not longer need the @keystone-6/auth package, yet others are going to experience this problem I believe.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:10
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

6reactions
jlarmstrongivcommented, Aug 22, 2022

Yes, I was surprised by this error running npx create-keystone-app followed by npm commands. You can also workaround this issue via npm overrides:

{
  "overrides": {
    "graphql-upload@15.0.2": {
      "graphql": "^15.8.0"
    }
  }
}

I’m very happy to see all the dependency updates! Upgrading jest and other deps helped solve a lot of problems for me. I see that prisma@4 was merged, and I’m looking forward to updating to graphql@16 too.

but you can just use yarn in the mean time

Unfortunately, that’s not a viable option for me.

3reactions
dmythrocommented, Aug 29, 2022

I’m very happy to see all the dependency updates! Upgrading jest and other deps helped solve a lot of problems for me. I see that prisma@4 was merged, and I’m looking forward to updating to graphql@16 too.

Oh yes! Waiting for graphql@16 upgrade too πŸ˜ƒ

Read more comments on GitHub >

github_iconTop Results From Across the Web

Should I have multiple GraphQL instances or just a single one?
https://stackoverflow.com/questions/54676109/should-i-have-multiple-graphql-instances-or-just-a-single-one.
Read more >
When to use multiple endpoints in GraphQL - LogRocket Blog
Exposing multiple endpoints in GraphQL is not the same as implementing REST β€” every REST endpoint provides access to a predefined resource orΒ ......
Read more >
Should I have multiple GraphQL instances or just a single one?
My company runs a microservice architecture that has 50+ services that are powered by a single GraphQL endpoint, which orchestrate the callsΒ ...
Read more >
Multiple GraphQL Operations in a Request - Dgraph
GraphQL requests can contain one or more operations. Operations include query, mutation, or subscription.
Read more >
Executing multiple queries concurrently
Multiple queries can be combined together, and executed as a single operation, ... For instance, the user's name field, with type String ,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found