Skip to content

graphql-code-generator broken with graphql-js 0.13.0 #184

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

Closed
jonaskello opened this issue Mar 9, 2018 · 4 comments
Closed

graphql-code-generator broken with graphql-js 0.13.0 #184

jonaskello opened this issue Mar 9, 2018 · 4 comments

Comments

@jonaskello
Copy link
Contributor

graphql/graphql-js#1221

I need to use 0.13.0 becuase there is a bug in 0.12.x that makes minification impossible. And all packages need the same version of graphql-js to make the instanceof checks work. And graphql-code-generator does not work with ^0.13.0 becuase it relies on 'graphql/language/kinds'.

Could it please be updated to work with 0.13.0?

@GD-Aichi
Copy link

GD-Aichi commented Mar 9, 2018

transform-document.ts

- import { OPERATION_DEFINITION, FRAGMENT_DEFINITION } from 'graphql/language/kinds';
+ import { Kind } from 'graphql';
...
- if (definitionNode.kind === OPERATION_DEFINITION) {
+ if (definitionNode.kind === Kind.OPERATION_DEFINITION) {
...
- } else if (definitionNode.kind === FRAGMENT_DEFINITION) {
+ } else if (definitionNode.kind === Kind.FRAGMENT_DEFINITION) {

build-selection-set.ts

- import { FIELD, FRAGMENT_SPREAD, INLINE_FRAGMENT } from 'graphql/language/kinds';
+ import { Kind } from 'graphql';
...
- if (selectionNode.kind === FIELD) {
+ if (selectionNode.kind === Kind.FIELD) {
...
- } else if (selectionNode.kind === FRAGMENT_SPREAD) {
+ } else if (selectionNode.kind === Kind.FRAGMENT_SPREAD) {
...
- } else if (selectionNode.kind === INLINE_FRAGMENT) {
+ } else if (selectionNode.kind === Kind.INLINE_FRAGMENT) {

this is the update

@dotansimha
Copy link
Owner

WIP: #187

@jonaskello
Copy link
Contributor Author

Looks awsome :-)

@dotansimha
Copy link
Owner

Fixed in 0.8.15 :) @jonaskello @GD-Aichi

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