Skip to content

Regression error using graphql v14 #556

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
emmanuelbuah opened this issue Aug 31, 2018 · 4 comments
Closed

Regression error using graphql v14 #556

emmanuelbuah opened this issue Aug 31, 2018 · 4 comments
Labels
core Related to codegen core/cli waiting-for-release Fixed/resolved, and waiting for the next stable release

Comments

@emmanuelbuah
Copy link

There's a regression error that surfaces using graphql v14

TypeError: Cannot read property 'slice' of undefined
    at buildDirective (../node_modules/graphql/utilities/buildClientSchema.js:286:51)
    at Array.map (<anonymous>)
    at Object.buildClientSchema (../node_modules/graphql/utilities/buildClientSchema.js:302:84)
    at Object.introspectionToGraphQLSchema (../node_modules/graphql-codegen-core/dist/utils/introspection-to-schema.js:11:22)
    at Request._callback (../node_modules/graphql-code-generator/dist/loaders/schema/introspection-from-url.js:59:48)
    at Request.self.callback (../node_modules/graphql-code-generator/node_modules/request/request.js:185:22)
    at Request.emit (events.js:182:13)
    at Request.<anonymous> (../node_modules/graphql-code-generator/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:182:13)
    at IncomingMessage.<anonymous> (../node_modules/graphql-code-generator/node_modules/request/request.js:1083:12)

This looks like its due to the breaking change by graphql/graphql-js#1429. More on changes in graphql v14 at graphql/graphql-js#1383

@IvanGoncharov
Copy link

@emmanuelbuah It's because of this change graphql/graphql-js#1429
This introspection format was deprecated for last few years so we removed it in 14.0.0 release.
What library do you use to implement GraphQL on your backend?

@emmanuelbuah
Copy link
Author

@IvanGoncharov I'm using apollo express server v1.4

@IvanGoncharov
Copy link

@emmanuelbuah Looks like everything good with your server and the bug happening because of this line:


I'm not sure why this library needs to remove directive locations.

It can't be fixed in 'graphql-js' but I will add explicit check and better error message on the next release.

@dotansimha
Copy link
Owner

Fixed in 0.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to codegen core/cli waiting-for-release Fixed/resolved, and waiting for the next stable release
Projects
None yet
Development

No branches or pull requests

3 participants