Hello, I would need to calculate on-the-fly queries filters in order to get data by certain conditions. In order to do that, I would pass these values as variable to GraphQL API, via Apollo Client. I’ve tried with the usual approach, for instance:
// Assuming previous declarations/dependencies definition
gql `
query Test($live: String!) {
{
queryArticleContents(filter: $live, top: 10) {
...ArticlesFragmentsArticleId
data {
...ArticlesFragmentsArticle
}
}
}
}
${Articles.fragments.articleId}
${Articles.fragments.article}
`
But I’m getting the exception;
Expected Name, found {
I think that’s because I’m not starting it as suggested in the docs, something like:
gql `
{
queryArticleContents(filter: 'foo', top: 10) {
// foo...
}
}
`
There’s any chance to achieve this?
Thanks in advance.