-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
null in params is converted to an empty object #187
Labels
bug
Something isn't working
Comments
Sorry for the delay. Thank you for your report. Solution 1: use GraphQL operation variablesThe better solution. const travelsQuery = gql('query($page: Int!, $top: Int!)', {
travels: params({ page: '$page', top: '$top' }, {
data: {
id: types.number,
}
})
})
axios.post({
query: travelsQuery.toString(),
variables: { page: page || 1, top: top || null, }
}) Solution 2: aliasHow about using const travelsQuery = gql({
[alias('travels', `travels(page: ${query.page || 1}, top: ${query.top || 'null'})`]: {
data: {
id: types.number,
}
}
}) |
I'll try to render |
@zabavnikov I've fixed and published v3.0.1 which includes the fix. Please try it out! Thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code:
Error: (I expect null)
The text was updated successfully, but these errors were encountered: