This is superb and so simple!
Scott Newcomer
1
Right. In my implementation, all GraphQL queries are a POST to my backend at /graphql with a “application/graphql” Content-Type header.
I wrote the network logic into an ember service called “backend” so that it can also add authorization headers etc.. Usage is simple:
this.get('backend').runQuery(
`
{
me {
id
email
}
}
`
).then(data => {
dispatch({ type: 'SET_CURRENT_USER', data });
});