Overview
  • Namespace
  • Class

Namespaces

  • WPGraphQL
    • Data
    • Type
      • Avatar
      • Comment
        • Connection
      • CommentAuthor
      • EditLock
      • Enum
      • MediaItem
        • Mutation
      • Plugin
        • Connection
      • PostObject
        • Connection
        • Mutation
      • PostType
      • Setting
      • Taxonomy
      • TermObject
        • Connection
        • Mutation
      • Theme
        • Connection
      • Union
      • User
        • Connection
        • Mutation
    • Utils

Classes

  • AppContext
  • Router
  • Types
  • WPSchema

Class Router

Class Router This sets up the /graphql endpoint

Namespace: WPGraphQL
Package: WPGraphQL
Since: 0.0.1
Located at Router.php

Methods summary

public
# __construct( )

Router constructor.

Router constructor.

Since

0.0.1
public static
# add_rewrite_rule( )

Adds rewrite rule for the route endpoint

Adds rewrite rule for the route endpoint

Since

0.0.1

Uses

WPGraphQL\Router::add_rewrite_rule()

Used by

WPGraphQL\Router::add_rewrite_rule()
public static array
# add_query_var( array $query_vars )

Adds the query_var for the route

Adds the query_var for the route

Parameters

$query_vars
The array of whitelisted query variables

Returns

array

Since

0.0.1
public static
# resolve_http_request( )

This resolves the http request and ensures that WordPress can respond with the appropriate JSON response instead of responding with a template from the standard WordPress Template Loading process

This resolves the http request and ensures that WordPress can respond with the appropriate JSON response instead of responding with a template from the standard WordPress Template Loading process

Since

0.0.1
public static
# send_header( string $key, string $value )

Sends an HTTP header.

Sends an HTTP header.

Parameters

$key
Header key.
$value
Header value.

Since

0.0.5
protected static
# set_status( integer $code )

Sends an HTTP status code.

Sends an HTTP status code.

Parameters

$code
HTTP status.

Since

0.0.5
public static
# set_headers( integer $http_status )

Set the response headers

Set the response headers

Parameters

$http_status
The status code to send as a header

Since

0.0.1
public static string
# get_raw_data( )

Retrieves the raw request entity (body).

Retrieves the raw request entity (body).

Returns

string
Raw request data.

Since

0.0.5
public static mixed
# process_http_request( )

This processes the graphql requests that come into the /graphql endpoint via an HTTP request

This processes the graphql requests that come into the /graphql endpoint via an HTTP request

Returns

mixed

Since

0.0.1

Properties summary

public static string $route

Sets the route to use as the endpoint

Sets the route to use as the endpoint

# 'graphql'
public static integer $http_status_code

Set the default status code to 403 to represent unauthenticated requests. Authenticated requests should set the status code to 200.

Set the default status code to 403 to represent unauthenticated requests. Authenticated requests should set the status code to 200.

# 403
API documentation generated by ApiGen