This is graphql.js related but I figure I could as...
# orm-help
k
This is graphql.js related but I figure I could ask around here. That function call,
ctx.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:
Copy code
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.