Github GraphQL in NodeJS App: A query attribute must be specified and must be a string. #24814
-
I have two different queries. The first is in a private repo:
The second is in a public repo:
The fetch for both look identical except the queries:
The first query returns:
The second query returns:
What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The issue was short hand object notation.
is shorthand for
which becomes
JSON.stringify({querytwo}) is shorthand for JSON.stringify({querytwo: querytwo}), or in other words it creates this query:
Hence why GraphQL couldn’t find a query - it found a queryTwo |
Beta Was this translation helpful? Give feedback.
-
I need help I’m new I’m kind of confuse |
Beta Was this translation helpful? Give feedback.
The issue was short hand object notation.
is shorthand for
which becomes
JSON.stringify({querytwo}) is shorthand for JSON.stringify({querytwo: querytwo}), or in other words it creates this query: