I\'m wondering if there\'s a way in GraphiQL that will let me pipe the result from one query / mutation into another query / mutation. Here\'s an example where the log
The purpose of the selection set in the mutations is to be able to fetch data that has changed as a result of the mutation. But it also makes it possible to fetch related data, as long as you can access is through the mutation result type.
Let's assume we have following types:
type Address {
city: String
}
type User {
addresses: [Address]
}
If the result (payload) type of the login
mutation includes a field viewer
of type User
that refers to the successfully logged in user, you can query any field of the User
in the result of the mutation:
mutation {
login(credentials: {
email: "me@me.com",
password: "password123",
passwordConfirmation: "password123"
}) {
viewer {
addresses {
city
}
}
}
}