You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, as far as I'm aware, there's no current way for the second mutation to access the query returned from the first mutation. An example use case is if a notebook must have at least one note (makes for better UX) and that a note must belong to a notebook. But since dynamic nested mutations aren't possible, instead of composing both of these mutations, I have to create a separate one, e.g. createNotebookWithNote and let the server handle the combining both actions.
The question/request: Would it be at all possible to nest mutations such that subsequent mutations can make use of queries returned from previous ones?
For example:
createNotebook(name: "example") {
id
name
createNote(notebookId: id) { // the id referenced here is of the recently created notebook
title
}
}
Obviously, the syntax would have to be different, and perhaps directives could be useful for this.
Has this feature been considered at all? It seems like it'd make mutations more powerful and composable, but if it's recommended to have the server handle these cases, then feel free to let me know and close this issue. :)
The text was updated successfully, but these errors were encountered:
I know that nested mutations are currently possible. For example:
However, as far as I'm aware, there's no current way for the second mutation to access the query returned from the first mutation. An example use case is if a notebook must have at least one note (makes for better UX) and that a note must belong to a notebook. But since dynamic nested mutations aren't possible, instead of composing both of these mutations, I have to create a separate one, e.g.
createNotebookWithNote
and let the server handle the combining both actions.The question/request: Would it be at all possible to nest mutations such that subsequent mutations can make use of queries returned from previous ones?
For example:
Obviously, the syntax would have to be different, and perhaps directives could be useful for this.
Has this feature been considered at all? It seems like it'd make mutations more powerful and composable, but if it's recommended to have the server handle these cases, then feel free to let me know and close this issue. :)
The text was updated successfully, but these errors were encountered: