haskell-graphql / graphql-api

Write type-safe GraphQL services in Haskell
BSD 3-Clause "New" or "Revised" License
406 stars 35 forks source link

Using lists in input types #176

Closed harendra-kumar closed 6 years ago

harendra-kumar commented 6 years ago

Is it possible to use lists in input arguments? For example:

data UserNames = UserNames
    { getUserNames :: [Text]
    } deriving (Generic, Show)

instance FromValue UserNames
instance Defaultable UserNames
instance HasAnnotatedInputType UserNames

Results in this error:

    • No instance for (HasAnnotatedInputType [Text])

I am not sure what the purpose HasAnnotatedInputType is, what does Annotated mean in the name? There seem to be no instance of this for List types i.e. [a]. Is that just missing or is it not possible to make it, or it does not make sense?

harendra-kumar commented 6 years ago

I can't find any tests passing lists in input objects, is it supported? Is there a right way to do it?

harendra-kumar commented 6 years ago

This is a duplicate of #142