graphql_authentication_error_status_code

apply_filters( 'graphql_authentication_error_status_code', 403, $auth_error );

Filter the HTTP status code returned for authentication errors. By default, invalid nonce errors return 403 Forbidden. Some clients may expect 200 with a GraphQL error response instead.

  • Type: filter
  • Group: Authentication and Authorization
  • Since: 2.6.0
  • Source File: plugins/wp-graphql/src/Router.php

Parameters

  • $status_code (int): The HTTP status code. Default 403.
  • $auth_error (\WP_Error): The authentication error.

Source

apply_filters( 'graphql_authentication_error_status_code', 403, $auth_error );