code: def graphql_impl(
      schema,
      source,
      root_value,
      context_value,
      variable_values,
      operation_name,
      field_resolver,
      type_resolver,
      middleware,
      execution_context_class,
  ) -> AwaitableOrValue[ExecutionResult]:
      
      # Validate Schema
      schema_validation_errors = validate_schema(schema)
      if schema_validation_errors:
          return ExecutionResult(data=None, errors=schema_validation_errors)
  
      # Parse
      try:
          document = parse(source)
      except GraphQLError as error:
          return ExecutionResult(data=None, errors=[error])
      except Exception as error:
          error = GraphQLError(str(error), original_error=error)
          return ExecutionResult(data=None, errors=[error])
  
      # Validate
      from .validation import validate
  
      validation_errors = validate(schema, document)
      if validation_errors:
          return ExecutionResult(data=None, errors=validation_errors)
  
      # Execute
      return execute(
          schema,
          document,
          root_value,
          context_value,
          variable_values,
          operation_name,
          field_resolver,
          type_resolver,
          middleware,
          execution_context_class,
      )
docs: Execute a query, return asynchronously only if necessary.