haskell-graphql / graphql-api

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

Pointers for how to implement HasAnnotatedInputType for records with more than 3 fields #197

Closed EdmundsEcho closed 6 years ago

EdmundsEcho commented 6 years ago

I've been working through the definition of toValue with the help of a couple of links posted in another issue related to FromValue. However, by definition of the volume of code, I feel as though I'm missing something. Is there anyone that might be able to suggest a way to implement HasAnnotatedInputType for the following data type?

data MixItemInput = MixItemInput
  { nameKey    :: Maybe Text
  , nameKeys   :: Maybe [Text]  
  , textValues :: Maybe [Text] 
  , intValues  :: Maybe [Int32]
  , spanValues :: Maybe [SpanInputType]  -- an instance of HasAnnotedInputType
  } deriving (Show, Generic)

Update The need to implement this has been made moot with the recent fix in deriving the instance generically (... now with more than 3 records).

- E

dminuoso commented 6 years ago

Fixed by https://github.com/haskell-graphql/graphql-api/pull/195/commits/5747b8896955ca0d092a203318be22f7b8a4c48c