graphql-api icon indicating copy to clipboard operation
graphql-api copied to clipboard

Have an InputObject combinator in the same spirit as Enum

Open teh opened this issue 9 years ago • 0 comments

Right now enums in our schema are marked explictly as such:

data DogCommandEnum = Sit | Down | Heel deriving (Show, Eq, Ord, Generic)
instance GraphQLEnum DogCommandEnum

type  D = Argument "dogCommand" ( Enum "DogCommand" DogCommandEnum) :> Field "doesKnowCommand" Bool

it might make sense to have an InputObject (name :: Symbol) (t :: Type) as well to mark input objects. This would be more consistent with Enum, and normal Object. It would allow us to require a specific ReadInputObject type class instead of FromValue but whether that's desirable is an open question.

Not a super clear design choice overall.

teh avatar Jan 18 '17 14:01 teh