Skip to content
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

Update graphql, relay-compiler, graphql-relay and fix breaking change #11377

Merged

Conversation

janicduplessis
Copy link
Contributor

@janicduplessis janicduplessis commented Jan 29, 2019

Description

This fixes compatibility with graphql@14+ and updates the version for all packages.

The breaking change that affects us is the removal of VariablesDefaultValueAllowed.

Removes VariablesDefaultValueAllowed validation rule, and ProvidedNonNullArguments became ProvidedRequiredArguments (#1274)

(https://github.com/graphql/graphql-js/releases/tag/v14.0.0)

Tested in a project by upgrading graphql to 14.1.1, also quicky audited the packages that use graphql to make sure they are not affected by breaking changes.

Before this change:

error UNHANDLED REJECTION


  TypeError: rule is not a function

  - Array.map

  - query-compiler.js:152
    [website]/[gatsby]/dist/internal-plugins/query-runner/query-compiler.js:152:    44

After:
Everything works 🙌

Related Issues

N/A

@janicduplessis janicduplessis requested a review from a team as a code owner January 29, 2019 05:49
@stefanprobst
Copy link
Contributor

Related: #9914
As noted in that issue, we would also have to update relay-compiler to v2.0.0

@janicduplessis
Copy link
Contributor Author

@stefanprobst From the tests I did the current version of relay compiler works fine with graphql@14. I’d rather keep this pr small if possible since updating the relay compiler might require other changes.

@stefanprobst
Copy link
Contributor

relay-compiler only officially supports graphql 14.0 since v2.0.0, which was released 3 days ago.

@freiksenet
Copy link
Contributor

Let's add relay-compiler upgrade to this too. It shouldn't affect us, but I don't feel it's right to upgrade graphql without upgrading relay-compiler.

@janicduplessis
Copy link
Contributor Author

janicduplessis commented Jan 31, 2019

@freiksenet Updated relay-compiler and graphql-relay to support graphql@14. Tested again and everything works fine with the updated relay-compiler and graphql-relay.

@janicduplessis janicduplessis changed the title Update graphql to 14.1.1, fix breaking change Update graphql, relay-compiler, relay-graphql and fix breaking change Jan 31, 2019
@janicduplessis janicduplessis changed the title Update graphql, relay-compiler, relay-graphql and fix breaking change Update graphql, relay-compiler, graphql-relay and fix breaking change Jan 31, 2019
@wardpeet
Copy link
Contributor

wardpeet commented Feb 1, 2019

@freiksenet I've tested this on our .org site and it seems to work..

$ yarn list | grep "graphql"
├─ babel-plugin-remove-graphql-queries@2.5.3
├─ eslint-plugin-graphql@2.1.1
│  ├─ graphql-config@^2.0.1
├─ express-graphql@0.6.12
│  ├─ babel-plugin-remove-graphql-queries@^2.5.3
│  ├─ eslint-plugin-graphql@^2.0.0
│  ├─ express-graphql@^0.6.12
│  ├─ graphql-playground-middleware-express@^1.7.10
│  ├─ graphql-relay@^0.6.0
│  ├─ graphql-skip-limit@^2.0.4
│  ├─ graphql-tools@^3.0.4
│  ├─ graphql-type-json@^0.2.1
│  ├─ graphql@^14.1.1
├─ graphql-config@2.2.1
│  ├─ graphql-import@^0.7.1
│  ├─ graphql-request@^1.5.0
│  ├─ graphql-request@1.8.2
├─ graphql-import@0.7.1
├─ graphql-playground-html@1.6.11
├─ graphql-playground-middleware-express@1.7.10
│  └─ graphql-playground-html@1.6.11
├─ graphql-relay@0.6.0
├─ graphql-request@1.6.0
├─ graphql-skip-limit@2.0.4
├─ graphql-tools@3.1.1
├─ graphql-type-json@0.2.1
├─ graphql@14.1.1
$ yarn list | grep "relay"
│  ├─ graphql-relay@^0.6.0
│  ├─ relay-compiler@2.0.0
├─ graphql-relay@0.6.0
├─ relay-compiler@2.0.0
│  ├─ relay-runtime@2.0.0
├─ relay-runtime@2.0.0

Copy link
Contributor

@freiksenet freiksenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot and millions of kudos to @wardpeet for testing this.

@freiksenet freiksenet merged commit a5b322d into gatsbyjs:master Feb 1, 2019
@gatsbot
Copy link

gatsbot bot commented Feb 1, 2019

Holy buckets, @janicduplessis — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. (Currently we’ve got a couple t-shirts available, plus some socks that are really razzing our berries right now.)
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants