graphql-parser: GraphQL API

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:

Please see the README on GitHub at https://github.com/hasura/graphql-parser-hs#readme


[Skip to Readme]

Properties

Versions 0.1.0.1
Change log ChangeLog.md
Dependencies aeson, attoparsec, base (>=4.7 && <5), containers, filepath, protolude, scientific, template-haskell, text, th-lift-instances, unordered-containers, vector [details]
License BSD-3-Clause
Copyright 2018 Hasura Technologies Pvt. Ltd.
Author Vamshi Surabhi
Maintainer vamshi@hasura.io
Category Web
Home page https://github.com/hasura/graphql-parser-hs#readme
Bug tracker https://github.com/hasura/graphql-parser-hs/issues
Source repo head: git clone https://github.com/hasura/graphql-parser-hs
Uploaded by nizar_m at 2018-08-21T07:57:48Z

Modules

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for graphql-parser-0.1.0.1

[back to package description]

graphql-parser

graphql-parser helps you parse the GraphQL Schema and Executable documents into Haskell data types (SchemaDocument and ExecutableDocument respectively).

Examples

Parsing GraphQL executable document

{-# LANGUAGE OverloadedStrings #-}
import Language.GraphQL (parseExecutableDoc)

main = do
  let ast = parseExecutableDoc "{ cat }"
  either (fail . show) f ast
  where
    f _ = return () -- The function which uses the ast goes here

Parsing GraphQL schema document

{-# LANGUAGE OverloadedStrings #-}
import Language.GraphQL (parseSchemaDoc)

main :: do
  let schema = parseSchemaDoc "type cat {name: String!}"
  either (fail . show) f ast
  where
    f _ = return () -- The function which uses the schema goes here