graphql-parser-0.1.0.0: GraphQL API

Copyright(c) 2018 Hasura Technologies Pvt. Ltd.
LicenseBSD3
MaintainerVamshi Surabhi <vamshi@hasura.io>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Language.GraphQL.June2018.TH

Description

Functions to Parse Graphql schema or executable documents at compile time

Synopsis

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 }")