Hello, as the title claims, I wold pass an element id
to a GraphQL query.
The query involved, due to my implementation, expects the id
as a string
, to retrieve a specific element as result. When the query beings called, I receive this exception:
‘GraphQL error: Variable “$idArticle” of type “String!” used in position expecting type “Guid!”.’
in which $idArticle
is the id
I want to pass as query variable to fetch data:
query Article($idArticle: String!) {
findArticleContent(id: $idArticle) {
...ArticlesFragmentsArticleId // <--- as its name suggests
data {
...ArticlesFragmentsArticle // <--- this fragment returns my data schema
}
}
}
${Articles.fragments.articleId}
${Articles.fragments.article}
How can I solve this one? I mean, which is the correct data format I should pass from the front-end client in order to run the query successfully? I never worked with guid
before, so any tip or advice will be appreciated.
Thanks in advance for your help.