GraphQL::Execution - Execute GraphQL queries


  use GraphQL::Execution qw(execute);
  my $result = execute($schema, $doc, $root_value);


Executes a GraphQL query, returns results.



  my $result = execute(
    $doc, # can also be AST

A GraphQL::Schema.


Either a GraphQL query document to be fed in to "parse" in GraphQL::Language::Parser, or a return value from that.


A root value that can be used by field-resolvers. The default one needs a code-ref, a hash-ref or an object.


A per-request scalar, that will be passed to field-resolvers.


A hash-ref, typically the decoded JSON object supplied by a client.


A string (or undef) that if given will be the name of one of the operations in the query.


A code-ref to be used instead of the default field-resolver.


If you need to return a promise, supply a hash-ref matching "PromiseCode" in GraphQL::Type::Library.