Given a mutation like this (see how nextArticle needs an ID passing):
mutation markArticleCompleteMutation(
$input: markArticleCompleteInput!
) {
markArticleComplete(input: $input) {
user {
nextArticle(excludeArticleId: $excludeArticleId) {
id
}
}
}
}
// Input looks like:
{
"input": {"completedId": "id123"}
}
how can I pass this from one of the input props?
I'd ideally like to write something like nextArticle(excludeArticleId: $input.completedId) but this doesn't seem to work
AFAIK you cannot access it like this. You have to define a separate variable and use it.
Notice the
excludeArticleIdis added to the list of variables of your document and it is defined separately in the variables map.Then the variables should be like this: