Closed frankcollins3 closed 1 year ago
I was gonna say it's kind of confusing that the query has to be: query links { links { id } }
👍 ? but I think I understand. links is the query and the second object is the resolver. 👎 ?
I didn't find this out on my own I clicked the ( + ) links [ Link]! button which is by Fields in the Left hand side "Documentation" part of the apollo sandbox.
[5:29pm]
dont need to open up a new issue for this. GraphQL feels redundant in 2 similar ways.
in the sandbox
**query pokemon {
pokemon {**
name,
id
}
}
but in the clientside fetch, the word query is used back to back. Seemingly like the word "pokemon" is used in sandbox
try {
const response = await axios.post('/api/graphql', {
**query: `
query {**
pokemon {
name
}
}
`,
// note this isn't a pokemon app just testing the moving of an HTTP endpoint from the graphql server
[10:11pm]
attempting to do: play in the sandbox until it's time to swim in the water
error:
proposed approach: dig around with endpoints. Also the link is an array of object data. doesn't hurt to start a little smaller like a simple string query