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

0.13-rc.1 notice for maintainers who build tools around graphql-js #1221

Closed
nodkz opened this issue Feb 1, 2018 · 4 comments
Closed

0.13-rc.1 notice for maintainers who build tools around graphql-js #1221

nodkz opened this issue Feb 1, 2018 · 4 comments

Comments

@nodkz
Copy link
Contributor

nodkz commented Feb 1, 2018

If your tool uses AST type checks something like:

import { LIST_TYPE, NON_NULL_TYPE, DOCUMENT, NAMED_TYPE } from 'graphql/language/kinds';

...
if (inputTypeAST.kind === LIST_TYPE) { ...

You need to change your code in following manner:

- import { LIST_TYPE, NON_NULL_TYPE, DOCUMENT, NAMED_TYPE } from 'graphql/language/kinds';
+ import { Kind } from 'graphql';

...
- if (inputTypeAST.kind === LIST_TYPE) { ...
+ if (inputTypeAST.kind === Kind.LIST_TYPE) { ...

According to last improvements for v0.13.0 by @IvanGoncharov you not able to import desired AST types directly from graphql/language/kinds.

And if you want that your tool must support new and old versions of graphql lib, please use code above.

@IvanGoncharov
Copy link
Member

If possible you should use:

  import { Kind } from 'graphql';

I didn't think it will break any 3rd-part code since graphql/* files are treated like private API.
@nodkz Did you use graphql/* files to minimize bundle size or you need to import some private APIs?

@nodkz
Copy link
Contributor Author

nodkz commented Feb 1, 2018

It breaks my graphql-compose, already fixed.
And at least 82 other public repos https://github.com/search?l=JavaScript&q=%22graphql%2Flanguage%2Fkinds%22&type=Code&utf8=%E2%9C%93

@nodkz
Copy link
Contributor Author

nodkz commented Feb 1, 2018

It's our problem, that we use internals imports.
So don't worry. Your work is amazing!

@leebyron
Copy link
Contributor

leebyron commented Feb 1, 2018

Thanks for highlighting this! I'm going to close the issue, but reference it as a potentially breaking change from the release notes!

@leebyron leebyron closed this as completed Feb 1, 2018
Yogu added a commit to AEB-labs/cruddl that referenced this issue Feb 28, 2018
They are not part of the official API and it broke in 0.13: graphql/graphql-js#1221
Yogu added a commit to AEB-labs/cruddl that referenced this issue Feb 28, 2018
They are not part of the official API and it broke in 0.13: graphql/graphql-js#1221
Yogu added a commit to AEB-labs/cruddl that referenced this issue Mar 1, 2018
They are not part of the official API and it broke in 0.13: graphql/graphql-js#1221
ajhyndman added a commit to ajhyndman/graphql-language-service that referenced this issue Sep 3, 2018
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

No branches or pull requests

3 participants