-
Notifications
You must be signed in to change notification settings - Fork 2k
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 built-in scalar's parseLiteral method to throw TypeError #1827
Conversation
Note: enum class also has graphql-js/src/type/definition.js Lines 1200 to 1205 in dfcdce7
It can be done in this or in a separate PR. |
8eeee77
to
9b57f73
Compare
@IvanGoncharov This PR should be good to go now. 🤞 I can fix |
src/type/scalars.js
Outdated
if (ast.kind !== Kind.INT) { | ||
throw new TypeError( | ||
`Int cannot represent non-integer value${ | ||
ast.value === undefined ? '.' : ': ' + inspect(ast.value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this expression is at the end of the string, I think simple string concatenation with +
would be more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
@danielrearden Sorry for the long delay. |
GraphQL 15 is stricter with enum values after graphql/graphql-js#1827
GraphQL 15 is stricter with enum values after graphql/graphql-js#1827
This addresses #1821