do_graphql_request

do_graphql_request( $query, $operation_name = '', $variables = [], $return_request = false );

Previous access function for running GraphQL queries directly. This function will eventually be deprecated in favor of graphql.

  • Since: 0.0.2
  • Source File: plugins/wp-graphql/access-functions.php

Parameters

  • $query (string): The GraphQL query to run
  • $operation_name (string): The name of the operation
  • $variables (array<string,mixed>): Variables to be passed to your GraphQL request
  • $return_request (bool): If true, return the Request object, else return the results of the request execution

Return

  • array<string,mixed>|\WPGraphQL\Request

Throws

  • \Exception

Recipes

Source

function do_graphql_request( $query, $operation_name = '', $variables = [], $return_request = false ) {