Skip to content

Cannot have Array Int as a Var? #112

@CGenie

Description

@CGenie

Hello,

I'm trying to create a GraphQL query template with variables. I have code like this:

type ContextsForNgramsQuery
  = { my_query :: Args
      { my_ids :: Var "my_ids" (Array Int) }
      {...} }

and I use it like this later:

{ my_query: Var :: _ "my_ids" (Array Int) } ==> ...

However, I'm getting this error:

  No type class instance was found for
                                          
    GraphQL.Client.Args.ArgGql Int        
                               (Array Int)
                                          

while solving type class constraint
                                                                         
  GraphQL.Client.Args.ArgGql Int                                         
                             (Var @Symbol @Type "ngrams_ids" (Array Int))

When I replace my_ids to Var "my_ids" Int, this compiles without errors.

Does this mean Array Int is not supported as ArgGql and if so, is there any reason to do this? Here

https://pursuit.purescript.org/packages/purescript-graphql-client/9.3.2/docs/GraphQL.Client.Args#t:ArgGql

I see in particular this instance:

instance argToGqlArray :: ArgGql param arg => ArgGql (Array param) (Array arg)

I guess we could add this as well?

instance ArgGql param arg => ArgGql param (Array arg)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions