is_graphql_request

is_graphql_request(): bool;

Whether a GraphQL request is in action or not. This is determined by the WPGraphQL Request class being initiated. True while a request is in action, false after a request completes. This should be used when a condition needs to be checked for ALL GraphQL requests, such as filtering WP_Query for GraphQL requests, for example. Default false.

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

Return

  • bool: True while a GraphQL request is in action, false otherwise.

Recipes

Source

function is_graphql_request(): bool {