I have an operation getFoo
that requires that the user is authenticated in order to access the resource.
User authenticates using a mutation authenticate
, e.g.
mutation {
authenticate (email: "foo", password: "bar") {
id
}
}
When user is authenticated, two things happen:
- The request context is enriched with the authentication details
- A cookie is created
However, I would like to combine authentication and getFoo
method invocation into a single request, e.g.
mutation {
authenticate (email: "foo", password: "bar") {
id
}
}
query {
getFoo {
id
}
}
The latter produces a syntax error.
Is there a way to combine a mutation with a query?