graphql/graphql.py
def graphql_impl(
    schema,
    source,
    root_value,
    context_value,
    variable_values,
    operation_name,
    field_resolver,
    middleware,
    execution_context_class,
) -> MaybeAwaitable[ExecutionResult]:
    """Execute a query, return asynchronously only if necessary."""
    # 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,
        middleware,
        execution_context_class,
    )
Execute a query, return asynchronously only if necessary.
Execute a query, return asynchronously only if necessary.
Execute a query return asynchronously only if necessary .
def graphql_impl(
    schema,
    source,
    root_value,
    context_value,
    variable_values,
    operation_name,
    field_resolver,
    middleware,
    execution_context_class,
) -> MaybeAwaitable[ExecutionResult]:
    schema_validation_errors = validate_schema(schema)
    if schema_validation_errors:
        return ExecutionResult(data=None, errors=schema_validation_errors)
    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])
    from .validation import validate
    validation_errors = validate(schema, document)
    if validation_errors:
        return ExecutionResult(data=None, errors=validation_errors)
    return execute(
        schema,
        document,
        root_value,
        context_value,
        variable_values,
        operation_name,
        field_resolver,
        middleware,
        execution_context_class,
    )
def graphql_impl ( schema , source , root_value , context_value , variable_values , operation_name , field_resolver , middleware , execution_context_class , ) -> MaybeAwaitable [ ExecutionResult ] : schema_validation_errors = validate_schema ( schema ) if schema_validation_errors : return ExecutionResult ( data = None , errors = schema_validation_errors ) 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 ] ) from . validation import validate validation_errors = validate ( schema , document ) if validation_errors : return ExecutionResult ( data = None , errors = validation_errors ) return execute ( schema , document , root_value , context_value , variable_values , operation_name , field_resolver , middleware , execution_context_class , )
Execute a query, return asynchronously only if necessary.
Execute a query return asynchronously only if necessary .
"""Execute a query, return asynchronously only if necessary.""" # Validate Schema # Parse # Validate # Execute
schema
source
root_value
context_value
variable_values
operation_name
field_resolver
middleware
execution_context_class