graphql

graphql( array $request_data = [], bool $return_request = false );

Provides a simple way to run a GraphQL query without posting a request to the endpoint.

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

Parameters

  • $request_data (array<string,mixed>): The GraphQL request data (query, variables, operation_name).
  • $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 graphql( array $request_data = [], bool $return_request = false ) {