Gatsby: Support new graphql major (15)

Created on 21 Jul 2020  路  2Comments  路  Source: gatsbyjs/gatsby

Description

graphql 15 has been out for a while now (3.5 months), and some libs are starting to upgrade. As a result, today I got this error message:

 Error: Cannot use GraphQLDirective "@cacheControl" 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.

Pinning graphql to 15.3.0 in resolutions makes gatsby crash when running gatsby develop.

Steps to reproduce

Run any gatsby projet with resolutions set to 15.3.0 for graphql.

Expected result

Gatsby should support the latest graphql major.

Actual result

Error on build.

Environment

  System:
    OS: macOS 10.15.5
    CPU: (4) x64 Intel(R) Core(TM) i7-7567U CPU @ 3.50GHz
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.4.0 - /var/folders/mt/71kkzssd3fq24s3x3y6wpc4h0000gn/T/yarn--1595324137736-0.6757048113533806/node
    Yarn: 1.22.4 - /var/folders/mt/71kkzssd3fq24s3x3y6wpc4h0000gn/T/yarn--1595324137736-0.6757048113533806/yarn
    npm: 6.14.5 - /usr/local/bin/npm
  Languages:
    Python: 2.7.16 - /usr/local/bin/python
  Browsers:
    Chrome: 84.0.4147.89
    Firefox: 72.0.2
    Safari: 13.1.1

Thanks in advance!

GraphQL bug

Most helpful comment

Yup, GraphQL has so many aspects in Gatsby that I think we will bump it with the next Gatsby major.

All 2 comments

graphql-js version 15 has a lot of new features, one of which鈥攊nterfaces that implement other interfaces鈥攊s nice to have when writing Gatsby GraphQL, since it lets you do interface Foo implements Node.

Yup, GraphQL has so many aspects in Gatsby that I think we will bump it with the next Gatsby major.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

3CordGuy picture 3CordGuy  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

Oppenheimer1 picture Oppenheimer1  路  3Comments

benstr picture benstr  路  3Comments

ferMartz picture ferMartz  路  3Comments