Skip to content

Instantly share code, notes, and snippets.

@hendrikniemann
Last active August 5, 2019 12:59
Show Gist options
  • Select an option

  • Save hendrikniemann/39054e783ccd857d7cccc1d9604db307 to your computer and use it in GitHub Desktop.

Select an option

Save hendrikniemann/39054e783ccd857d7cccc1d9604db307 to your computer and use it in GitHub Desktop.
Medium Post: Why is a pure FP GraphQL implementation so hard to build?
postType :: GraphQL.ObjectType Context (Maybe Post)
postType =
GraphQL.objectType
"Post"
(Just "A blog post that is persisted in the database.")
{ comments:
GraphQL.field
(GraphQL.nonNull $ GraphQL.list $ GraphQL.nonNull GraphQL.string)
(Just "The title of this blog post.")
{ max:
GraphQL.argument
GraphQL.id
(Just "The unique id that references this post.")
}
?resolver -- resolver :: Post -> { max: Maybe Int } -> Context -> Aff (Array Comment)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment