graphql-0.8.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, VariableValue a) 
=> Schema m

Resolvers.

-> HashMap Name a

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, VariableValue a) 
=> Schema m

Resolvers

-> Text

Operation name.

-> HashMap Name a

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.