newtype Thingy = Thingy Text deriving (Eq, Ord, Show)
instance ToValue Thingy where
toValue (Thingy x) = toValue x
type QueryRoot = Object "QueryRoot" '[]
'[ Field "thingy" Thingy
]
rootHandler :: Handler IO QueryRoot
rootHandler = thingyHandler
thingyHandler :: Handler IO Thingy
thingyHandler = pure $ Thingy "content"
But this gives me the following warning:
[-Wdeferred-type-errors]
• Couldn't match expected type ‘Handler IO Thingy’
with actual type ‘f0 Thingy’
The type variable ‘f0’ is ambiguous
• In the expression: pure $ Thingy "content"
In an equation for ‘thingyHandler’:
thingyHandler = pure $ Thingy "content"
I think this is because we don't have a HasResolver instance. It seems a bit odd that I, the user, would have to provide one.
I want to do something like this:
But this gives me the following warning:
I think this is because we don't have a
HasResolver
instance. It seems a bit odd that I, the user, would have to provide one.