executeRequest static method

Future<Map<String, Object?>> executeRequest(
  1. Object? body, {
  2. bool authenticated = false,
})

Runs a decoded GraphQL-over-HTTP request body: query, variables, operationName, and the persisted-query hash at extensions.persistedQuery.sha256Hash.

What the generated /graphql route calls. A hash has to reach persistedQueries for it to mean anything: sent alone it names the document to run, and sent beside a document it must be that document's hash. A body that is not an object is an empty request.

Implementation

static Future<Map<String, Object?>> executeRequest(
  Object? body, {
  bool authenticated = false,
}) {
  final _DVGraphQLRequest request = _DVGraphQLRequest.of(body);
  return execute(
    request.query,
    variables: request.variables,
    operationName: request.operationName,
    persistedQueryHash: request.hash,
    authenticated: authenticated,
  );
}