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

GraphQL v16 compatibility #140

Merged
merged 2 commits into from Nov 2, 2021

Conversation

ardatan
Copy link
Contributor

@ardatan ardatan commented Oct 27, 2021

GraphQL v16 has been released recently so this PR does the following changes for the compatibility;

  • Type resolvers no longer returns type itself but the name of the type because this no longer supported in v16
  • Update TS version because v16 doesn't support existing version
  • Add tests for both v15 and v16
  • Use the custom implementation of collectFields in json.ts because it has been changed in v16
  • Fix typing issues
  • Use isSubType instead of isPossibleType because it has been removed in v16
  • Replace toEqual with toMatchObject to compare results because GraphQLError is no longer serialized like JSO
  • Remove Node 10 from CI because v16 doesn't support it and it has been no longer maintained.
  • Update TS version to support latest changes and v16
  • Migrate to ESlint and update Prettier to support new TypeScript ESLint plugin

@ardatan
Copy link
Contributor Author

ardatan commented Oct 31, 2021

Is there anything missing to get this merged?

@ardatan
Copy link
Contributor Author

ardatan commented Nov 1, 2021

Sorry it is my bad :( Could you run it again? @boopathi

@ardatan
Copy link
Contributor Author

ardatan commented Nov 1, 2021

I hate to ask but I need another :) Is it possible to make this automatic only for this PR ? @boopathi

@ardatan
Copy link
Contributor Author

ardatan commented Nov 1, 2021

I removed Node 10 because v16 doesn't support it and it has been no longer maintained. @boopathi That's why CI failed :/

@ruiaraujo
Copy link
Collaborator

@ardatan switch from node 15 to node 16 on the build.

@dotansimha
Copy link

@ruiaraujo @boopathi @topicus can you please review this PR? seems like it's breaking on other tools as well (envelop / graphql-mesh) and blocks the ability to upgrade.

.vscode/settings.json Outdated Show resolved Hide resolved
@ardatan
Copy link
Contributor Author

ardatan commented Nov 1, 2021

@ruiaraujo Done!

@ardatan
Copy link
Contributor Author

ardatan commented Nov 1, 2021

@ruiaraujo I also ran prettier and ts-lint to fix format/lint issues.

src/execution.ts Outdated Show resolved Hide resolved
@ruiaraujo
Copy link
Collaborator

@ardatan the build is still complaining about the formatter.

@ardatan
Copy link
Contributor Author

ardatan commented Nov 1, 2021

@ruiaraujo Prettier's TSLint plugin fails because TSLint doesn't know about the following syntax;

} catch(e: any) { //Casting errors which necessary for TS

While we need the syntax above for TS v4
TS v4 is needed for GraphQL v16 but TS v4 isn't supported by TSLint
TSLint is deprecated and should be replaced with ESLint.

I can do that in this PR?

@ruiaraujo
Copy link
Collaborator

@ardatan yes

@ruiaraujo
Copy link
Collaborator

@ardatan we also need to conver https://github.com/zalando-incubator/graphql-jit/blob/master/tslint.json to eslint.json

@ardatan
Copy link
Contributor Author

ardatan commented Nov 1, 2021

I think rules are fine now since TSLint rules don't exist as-is in ESLint.
Update: I converted them anyway and I updated prettier so I needed to configure trailingCommas there.

@ruiaraujo
Copy link
Collaborator

@ardatan almost there, you're getting closer. 😄

@ardatan
Copy link
Contributor Author

ardatan commented Nov 1, 2021

I hope this time it will pass @ruiaraujo :)

@ruiaraujo
Copy link
Collaborator

👍

@ardatan
Copy link
Contributor Author

ardatan commented Nov 1, 2021

I think you need to update repo settings for "Expected" workflows

@ruiaraujo
Copy link
Collaborator

@ardatan we will do it when we are ready to merge with the second review, no worries. Thanks for the great contribuition.

@addityasingh
Copy link
Contributor

@ardatan can you fix the conflicts since we merged your other PR #139 ?

@ardatan ardatan force-pushed the graphql-v16-test branch 2 times, most recently from 5daa5cd to 7287de6 Compare November 1, 2021 17:30
@ardatan
Copy link
Contributor Author

ardatan commented Nov 1, 2021

Done @addityasingh @ruiaraujo @boopathi

@ruiaraujo
Copy link
Collaborator

👍

@ardatan
Copy link
Contributor Author

ardatan commented Nov 2, 2021

@ruiaraujo @boopathi @topicus @addityasingh When could this get merged and released? We really need this for our libraries in order to upgrade to GraphQL v16 :/

package.json Outdated
"jest": "^24.7.1",
"lint-staged": "^8.1.5",
"prettier": "^1.19.1",
"prettier": "^2.4.1",
"ts-jest": "^24.0.2",
"ts-node": "^8.0.3",
"tslint": "^5.15.0",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.0.1",
Copy link
Member

Choose a reason for hiding this comment

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

Will tslint dependencies still be needed even if we move to eslint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! Removed!

Copy link
Member

Choose a reason for hiding this comment

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

I'll keep it open until the change is pushed, for visibility

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad :) I forgot to push

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you take a look if it is good for you? @oporkka

src/error.ts Show resolved Hide resolved
@ruiaraujo
Copy link
Collaborator

👍

1 similar comment
@oporkka
Copy link
Member

oporkka commented Nov 2, 2021

👍

@ruiaraujo ruiaraujo merged commit 2876dd8 into zalando-incubator:master Nov 2, 2021
@ardatan
Copy link
Contributor Author

ardatan commented Nov 2, 2021

Thank you <3

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

5 participants