Argument of #import passed to parser was not a valid GraphQL DocumentNode
See original GitHub issuedocument
is the raw file plain text. which throws
query PersonQuery(
$id: ID!
) {
person(id: $id) {
...personFragment
}
}
passed to parser was not a valid GraphQL DocumentNode. You may need to use 'graphql-tag' or another method to convert your operation into a document
parser
react-apollo.browser.umd.js:229:4
graphql
react-apollo.browser.umd.js:374:20
<unknown>
index.js:12:10
loadModuleImplementation
require.js:212:4
guardedLoadModule
require.js:146:11
_require
require.js:130:2
<unknown>
registerScreens.js:3
loadModuleImplementation
require.js:212:4
guardedLoadModule
require.js:146:11
function parser(document) {
var variables, type, name
invariant$2(
!!document && !!document.kind,
'Argument of ' +
document +
" passed to parser was not a valid GraphQL DocumentNode. You may need to use 'graphql-tag' or another method to convert your operation into a document"
)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Argument of undefined passed to parser was not a valid ...
I do import graphQL query as: import {getStudents} from'./../graphql/Queries.graphql' Queries.graphql file: query getStudents($schoolID: ...
Read more >passed to parser was not a valid GraphQL DocumentNode ...
No need to add graphql. import gql from 'graphql-tag'; const listMessages = gql query listMessages { listMessages { id text createdAt sentBy ...
Read more >passed to parser was not a valid GraphQL DocumentNode ...
Coding example for the question passed to parser was not a valid GraphQL DocumentNode.you ... import gql from 'graphql-tag'; const listMessages = gql...
Read more >Argument of undefined passed to parser was not a valid ...
Argument of undefined passed to parser was not a valid GraphQL DocumentNode. ... I do import graphQL query as: import {getStudents} from'.
Read more >Compiling queries with Babel - Apollo GraphQL Docs
Now any import statements importing from a GraphQL file type will return a ready-to-use GraphQL DocumentNode object. JavaScript.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just applied one of the caveats: “Applying changes to GraphQL files” and it seems to have fixed it (might have been reloading the project etc that fixed it, probably one of the two).
tldr: It seems fixed for me now =]
@detrohutt Thanks for the ping! Just a note:
bable-plugin-inline-import-graphql-ast@^2.3.2
should bebabel-plugin-inline-import-graphql-ast@^2.3.2
I got a 404 and took me a while to realise why =P