-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
I ran into a snag when trying to define an object of type X that has a field with type X. This will not compile:
commentType :: ObjectType Unit Unit
commentType = objectType
"Comment"
(Just "comment")
{ replies: Q.field' (Q.list commentType) -- "The value commentType is not defined here"
(Just "replies")
\_ ctx -> pure (Just []) }
It also doesn't seem possible to use Data.Lazy.fix
to achieve this. However, there is a comment in graphql-91 that explains you can do this in JavaScript using a thunk, so I think another wrapper function around objectType
that has the type of it's last argument as (Unit -> Record fields)
might do the trick.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request