-
Notifications
You must be signed in to change notification settings - Fork 6
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
Cannot have Array Int
as a Var
?
#112
Comments
It should support an But it could be an issue with the newer purs version handling class instances differently. Are you able to add a minimal, reproducible example so that I can see if this is a bug in the library or a schema/value mismatch?
That would allow arrays to be used where the schema specifies a single value type so I think would cause runtime errors |
With something like this https://paste.sr.ht/~cgenie/48ee5986da096f80cfbdce68bc2185ec10d5fc35 I'm getting this error:
I'm using ps 0.15.7. |
Anyone have an idea what's going on here? :) |
As a workaround, I added newtype Ids = Array Int
instance EncodeJson Ids where
encodeJson (Ids ids) = encodeJson ids
instance ArgGql Int Ids
instance VarTypeName Ids where
varTypeName _ = "Ids!" and replaced EDIT: It should be instance VarTypeName Ids where
varTypeName _ = "[Int!]!" instead. Otherwise you need to introduce the |
Hello,
I'm trying to create a GraphQL query template with variables. I have code like this:
and I use it like this later:
However, I'm getting this error:
When I replace
my_ids
toVar "my_ids" Int
, this compiles without errors.Does this mean
Array Int
is not supported asArgGql
and if so, is there any reason to do this? Herehttps://pursuit.purescript.org/packages/purescript-graphql-client/9.3.2/docs/GraphQL.Client.Args#t:ArgGql
I see in particular this instance:
I guess we could add this as well?
The text was updated successfully, but these errors were encountered: