graphql-api
graphql-api copied to clipboard
Have an InputObject combinator in the same spirit as Enum
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.