Graphql: Execution Module Cheat Sheet

function execute

Executes a GraphQL request on the provided schema.

export function execute(
  schema: GraphQLSchema,
  documentAST: Document,
  rootValue?: mixed,
  contextValue?: mixed,
  variableValues?: ?{[key: string]: mixed},
  operationName?: ?string
): MaybePromise<ExecutionResult>

type MaybePromise<T> = Promise<T> | T;

type ExecutionResult = {
  data: ?Object;
  errors?: Array<GraphQLError>;
}

Leave a Reply

Your email address will not be published. Required fields are marked *