KyleG
05/10/2018, 4:49 AMctx.db.query.user(...)
. It looks for a user with a particular id
as the query argument. I know how that is defined, so I don't need help with that.
But it's the query fields I'm lost on. For example, if the query looked like this:
me {
id
email
}
Those fields id
and email
I figure are defined in the info
variable. But printing that variable to console doesn't reveal much other than it's a big hairy object that's difficult to read.
How do I define and run my own queries internally? Say I wanted to write a query internally that checks something for me?
The way I've learned GraphQL is through tutorials and example code, so to change things I struggle. And it's hard to Google around for this stuff! I imagine the answer might involve graphql-tag's gql
template literal (https://github.com/apollographql/graphql-tag), which I'm familiar with when using Apollo in my client... but I need hints.