Copyright | (c) 2018 Hasura Technologies Pvt. Ltd. |
---|---|
License | BSD3 |
Maintainer | Vamshi Surabhi <vamshi@hasura.io> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Functions to Parse Graphql schema or executable documents at compile time
- parseSchemaDocQ :: FilePath -> Q Exp
- parseExecutableDocQ :: FilePath -> Q Exp
Documentation
parseSchemaDocQ :: FilePath -> Q Exp Source #
Parse GraphQL schema at compile time
{-# LANGUAGE OverloadedStrings, TemplateHaskell #-} import Language.GraphQL.June2018.TH (parseSchemaDocQ) import Language.GraphQL.June2018.Syntax (SchemaDocument) schemaFoo :: SchemaDocument schemaFoo = $(parseSchemaDocQ "type cat {name: String!}")
parseExecutableDocQ :: FilePath -> Q Exp Source #
Parse GraphQL executable document at compile time
{-# LANGUAGE OverloadedStrings, TemplateHaskell #-} import Language.GraphQL.June2018.TH (parseExecutableDocQ) import Language.GraphQL.June2018.Syntax (ExecutableDocument) execFoo :: ExecutableDocument execFoo = $(parseExecutableDocQ "{ cat }")