Using V2 graphql - having a problem where the passed variable is not an Int so the page query doesn't work:
[{"message":"Variable \"$page\" of required type \"Int!\" was not provided.","locations":[{"line":2,"column":16}]}]
PAGINATEDPOSTS Query:
Posts(limit: 9, page: $page) {
docs {
title
slug
}
totalPages
page
}
}```
Fetch request:
```const { data, errors } = await fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/graphql`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
query: PAGINATEDPOSTS,
variable: {
page: pageNum,
},
}),
next: {
tags: ['posts'],
},
}).then(res => res.json())```
`pageNum` comes from next url param such as `1` - this happens on playground also if the input variable is given as a string (double quotes) but not when given as an Int or single quotes will return the correct query but ignores the page variable entirely.
Not sure if I am doing something wrong, or if this is a bug?