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

Fix graphql-tag/loader by properly stringifying GraphQL source #65

Merged
merged 2 commits into from
May 16, 2017

Conversation

jnwng
Copy link
Contributor

@jnwng jnwng commented Mar 22, 2017

Per discussion on #64, the source (which is part of the GraphQL document) was not properly being stringified and cached in the javascript being generated by the Webpack loader, which caused issues when attempting to interpolate documents retrieved via said loader.

@jnwng
Copy link
Contributor Author

jnwng commented May 9, 2017

i understand how to fix this, so will try and get a proper fix submitted this week

jnwng added 2 commits May 10, 2017 18:38
[Loc.prototype.toJson](https://github.com/graphql/graphql-js/blob/77f2785e6c740a95e7615dad41e4ac1b663cea0e/src/language/parser.js#L1048-L1050) will never return the `source` key (which holds the stringified version of the query that we need when using the Webpack loader. We'll manually add it since the reference to `source` still exists on `doc.loc`
@jnwng jnwng requested a review from stubailo May 11, 2017 01:40
@jnwng jnwng changed the title Adding failing test for #64 Fix graphql-tag/loader by properly stringifying GraphQL source May 11, 2017
@stubailo
Copy link
Contributor

This looks good! Seems to properly work around the change that made loc not enumerable.

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.

2 participants