graphql-0.7.0.0: Haskell GraphQL implementation

Safe HaskellNone
LanguageHaskell2010

Language.GraphQL.Execute

Description

This module provides functions to execute a GraphQL request.

Synopsis

Documentation

execute Source #

Arguments

:: Monad m 
=> HashMap Text (NonEmpty (Resolver m))

Resolvers.

-> Subs

Variable substitution function.

-> Document 
-> m Value 

The substitution is applied to the document, and the resolvers are applied to the resulting fields.

Returns the result of the query against the schema wrapped in a data field, or errors wrapped in an errors field.

executeWithName Source #

Arguments

:: Monad m 
=> HashMap Text (NonEmpty (Resolver m))

Resolvers

-> Text

Operation name.

-> Subs

Variable substitution function.

-> Document

GraphQL Document.

-> m Value 

The substitution is applied to the document, and the resolvers are applied to the resulting fields. The operation name can be used if the document defines multiple root operations.

Returns the result of the query against the schema wrapped in a data field, or errors wrapped in an errors field.