You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 26, 2023. It is now read-only.
Given I have a users connection that accepts an input type that accepts a where argument, this where input type has a couple of optional arguments. With GraphQL, you can query like so:
In my reason-apollo app, the user can specify these filters and so the where is constructed in my app and passed via the query's variables to the appropriate connection.
In order to construct the where, I have to specify all the Some and None values so it matches the type.
let where = {
username: Some({_eq: "lee"})
bot: None
}
Here's the problematic part, when I use this where as variables for the query, this None will be transformed to nil and send to the GraphQL server. As nil isn't valid input, the server will return a 500.
I'm quite new to the Reason and Apollo game, but I guess the fix for this case would be to use {} rather than nill as None value or remove the entries that have a None value.
What do you think?
The text was updated successfully, but these errors were encountered:
@baransu I saw that glennsl/bs-json/issues/50 got resolved, but I have troubles understanding how I can apply this. Can you help me how I can omit the null values from the where I've posted in the example?
The issue still exists in mhallin/graphql_ppx#59. Please check my latest comment. I know how this could be fixed but I'm missing knowledge about OCaml AST generation and how to implement it.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Given I have a
users
connection that accepts an input type that accepts awhere
argument, thiswhere
input type has a couple of optional arguments. With GraphQL, you can query like so:In my reason-apollo app, the user can specify these filters and so the where is constructed in my app and passed via the query's variables to the appropriate connection.
In order to construct the
where
, I have to specify all the Some and None values so it matches the type.Here's the problematic part, when I use this
where
as variables for the query, thisNone
will be transformed tonil
and send to the GraphQL server. Asnil
isn't valid input, the server will return a 500.I'm quite new to the Reason and Apollo game, but I guess the fix for this case would be to use
{}
rather thannill
asNone
value or remove the entries that have aNone
value.What do you think?
The text was updated successfully, but these errors were encountered: