def METHOD_NAME(
    workspace_process_context: WorkspaceProcessContext,
    query: str,
    variables: Optional[Mapping[str, object]] = None,
):
    check.inst_param(
        workspace_process_context, "workspace_process_context", WorkspaceProcessContext
    )
    check.str_param(query, "query")
    check.opt_mapping_param(variables, "variables")
    query = query.strip("'\" \n\t")
    context = workspace_process_context.create_request_context()
    result = create_schema().execute(
        query,
        context_value=context,
        variable_values=variables,
    )
    result_dict = result.formatted
    # Here we detect if this is in fact an error response
    # If so, we iterate over the result_dict and the original result
    # which contains a GraphQLError. If that GraphQL error contains
    # an original_error property (which is the exception the resolver
    # has thrown, typically) we serialize the stack trace of that exception
    # in the 'stack_trace' property of each error to ease debugging
    if "errors" in result_dict:
        result_dict_errors = check.list_elem(result_dict, "errors", of_type=Exception)
        result_errors = check.is_list(result.errors, of_type=Exception)
        check.invariant(len(result_dict_errors) == len(result_errors))  #
        for python_error, error_dict in zip(result_errors, result_dict_errors):
            if hasattr(python_error, "original_error") and python_error.original_error:
                error_dict["stack_trace"] = get_stack_trace_array(python_error.original_error)
    return result_dict