Language.GraphQL.Execute

Description

This module provides the function to execute a GraphQL request -- according to a Schema.

Synopsis

# Documentation

execute :: MonadIO m => Schema m -> Subs -> Document -> m Value Source #

Takes a Schema, a variable substitution function (Subs), and a GraphQL document. The substitution is applied to the document using rootFields, and the Schema's 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 :: MonadIO m => Schema m -> Text -> Subs -> Document -> m Value Source #

Takes a Schema, operation name, a variable substitution function (Subs), and a GraphQL document. The substitution is applied to the document using rootFields, and the Schema's 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.