Copyright | (c) 2018 Hasura Technologies Pvt. Ltd. |
---|---|
License | BSD3 |
Maintainer | Vamshi Surabhi <vamshi@hasura.io> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
How to use this library
This module exposes functions dealing with parsing GraphQL schema and executable documents.
Parsing GraphQL executable documents
{-# LANGUAGE OverloadedStrings #-} import qualified Language.GraphQL.June2018.Parser as AST main = do let ast = AST.parseExecutableDoc "{ cat }" either (fail . show) f ast where f _ = return () -- The function which uses the ast
Parsing GraphQL schema
{-# LANGUAGE OverloadedStrings #-} import qualified Language.GraphQL.June2018.Parser as AST main :: do let schema = AST.parseSchemaDoc "type cat {name: String!}" either (fail . show) f ast where f _ = return () -- The function which uses the schema
GraphQL functions
parseExecutableDoc :: Text -> Either Text ExecutableDocument Source #
Parse an executable document into GraphQL Abstract Syntax Tree
parseSchemaDoc :: Text -> Either Text SchemaDocument Source #
Parse a schema document
Parsers
executableDocument :: Parser ExecutableDocument Source #
Parser for GraphQL Abstract Syntax Tree
schemaDocument :: Parser SchemaDocument Source #
Parser for GraphQL schema