src/GraphQL.php
public static function executeQuery(
        SchemaType $schema,
        $source,
        $rootValue = null,
        $context = null,
        $variableValues = null,
        ?string $operationName = null,
        ?callable $fieldResolver = null,
        ?array $validationRules = null
    ) : ExecutionResult {
        $promiseAdapter = new SyncPromiseAdapter();

        $promise = self::promiseToExecute(
            $promiseAdapter,
            $schema,
            $source,
            $rootValue,
            $context,
            $variableValues,
            $operationName,
            $fieldResolver,
            $validationRules
        );

        return $promiseAdapter->wait($promise);
    }
public static function executeQuery(
        SchemaType $schema,
        $source,
        $rootValue = null,
        $context = null,
        $variableValues = null,
        ?string $operationName = null,
        ?callable $fieldResolver = null,
        ?array $validationRules = null
    ) : ExecutionResult {
        $promiseAdapter = new SyncPromiseAdapter();

        $promise = self::promiseToExecute(
            $promiseAdapter,
            $schema,
            $source,
            $rootValue,
            $context,
            $variableValues,
            $operationName,
            $fieldResolver,
            $validationRules
        );

        return $promiseAdapter->wait($promise);
    }
Executes graphql query.

More sophisticated GraphQL servers, such as those which persist queries,
may wish to separate the validation and execution phases to a static time
tooling step, and a server runtime step.

Available options:

schema:
The GraphQL type system to use when validating and executing a query.
source:
A GraphQL language formatted string representing the requested operation.
rootValue:
The value provided as the first argument to resolver functions on the top
level type (e.g. the query object type).
context:
The value provided as the third argument to all resolvers.
Use this to pass current session, user data, etc
variableValues:
A mapping of variable name to runtime value to use for all variables
defined in the requestString.
operationName:
The name of the operation to use if requestString contains multiple
possible operations. Can be omitted if requestString contains only
one operation.
fieldResolver:
A resolver function to use when one is not provided by the schema.
If not provided, the default field resolver is used (which looks for a
value on the source value with the field's name).
validationRules:
A set of rules for query validation step. Default value is all available rules.
Empty array would allow to skip query validation (may be convenient for persisted
queries which are validated before persisting and assumed valid during execution)

@param string|DocumentNode $source
@param mixed               $rootValue
@param mixed               $context
@param mixed[]|null        $variableValues
@param ValidationRule[]    $validationRules

@api