Default Types and Fields
On this page you will find information about the default Types and Fields that are generated by WPGraphQL.
The Types registered by WPGraphQL can be used by 3rd party plugins that are registering GraphQL fields, connections, arguments and inputs.
Types must be unique in the Schema, so any Type already declared by WPGraphQL should not be re-declared by plugins extending WPGraphQL.
De-registering or removing Types from the Schema is not supported.
WPGraphQL Registers the following Scalars for use throughout the Schema.
While WPGraphQL doesn't currently ship with any Custom Scalar types, there is an API to register custom Scalar types.
Next, WPGraphQL registers Interfaces. Interfaces are special Types that declare common fields that Object Types have in common. The following Interfaces are registered by default:
Next, Object Types are registered to represent common Types of data managed in WordPress.
- PostObjects: the GraphQL Type for each post type set to "show_in_graphql"
- TermObjects: the GraphQL Type for each Taxonomy set to "show_in_graphql"
- An Object Type is registered for each Page Template based on it's Template Name.
Connections are composed of many Types. Each connection registered creates a Type in the Schema named after the FromType and ToType, and creates additional Types for "Where" args to filter and sort the connections.
Connections are registered from Connected Types to the following.
For example, Connections are registered from the RootQuery to Comments, from Users to Comments, from Posts to Comments, etc.
WPGraphQL generates the following Mutations:
- Post Types:
- create, update and delete mutations are registered for each post type that's set to show in GraphQL.
- create, update and delete mutations are registered for each post type that's set to show in GraphQL