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
- ACF Nav Menu Plugin Support
- Add Edit Link to All Post Types
- Add field for unencoded content
- Add WP Admin Color Schemes to WPGraphQL
- Allow login mutation to be public when the endpoint is fully restricted
- Changing the Server Debug Flag
- Filter to add restricted field on Model
- Fix pagination conflict with the “Advanced Taxonomy Terms Order” plugin
- Fix pagination conflict with the “Post Type Order” plugin
- Making Menus and Menu Items public
- Popular Posts
- Register a basic Mutation
- Register object and field for custom list of users
- Remove Extensions from GraphQL Response
- Showing Post Type labels in public queries
- Tag to Content Node Connection
- Update WPGraphQL Endpoint URL
- Using GraphQL Fragments in PHP
Source
function graphql( array $request_data = [], bool $return_request = false ) {