Transform your WordPress site into a modern GraphQL server: gatographql.com.
This plugin is the implementation for WordPress of GraphQL by PoP, a CMS-agnostic GraphQL server in PHP.
👀 Instructions: Installing Gato GraphQL.
👀 Instructions: Setting-up the development environment.
Compiled JavaScript code (such as all files under a block's build/ folder) is added to the repo, but only as compiled for production, i.e. after running npm run build.
Code compiled for development, i.e. after running npm start, cannot be committed/pushed to the repo.
Gato GraphQL is extensible, and ships with the following modules (organized by category):
| Module | Description |
|---|---|
Endpoint | |
| Single Endpoint | Expose the single GraphQL endpoint under /graphql/ |
Schema Configuration | |
| Schema Configuration | Customize the schema accessible to different endpoints, by applying a custom configuration (involving namespacing, access control, cache control, and others) to the grand schema |
| Schema Namespacing | Automatically namespace types with a vendor/project name, to avoid naming collisions |
| Nested Mutations | Execute mutations from any type in the schema, not only from the root |
| Public/Private Schema | Enable to communicate the existence of some field from the schema to certain users only (private mode) or to everyone (public mode). If disabled, fields are always available to everyone (public mode) |
User Interface | |
| Excerpt as Description | Provide a description of the different entities (Custom Endpoints, Persisted Queries, and others) through their excerpt |
Clients | |
| GraphiQL for Single Endpoint | Make a public GraphiQL client available under /graphiql/, to execute queries against the single endpoint. It requires pretty permalinks enabled |
| Interactive Schema for Single Endpoint | Make a public Interactive Schema client available under /schema/, to visualize the schema accessible through the single endpoint. It requires pretty permalinks enabled |
Schema Type | |
| Expose Sensitive Data in the Schema | Expose “sensitive” data elements in the GraphQL schema (such as field Root.roles, field arg Root.posts(status:), and others), which provide access to potentially private user data |
| Self Fields | Expose "self" fields in the GraphQL schema (such as Post.self and User.self), which can help give a particular shape to the GraphQL response |
Operational | |
| Composable Directives | Have directives modify the behavior of other directives |
| Multi-Field Directives | A single directive can be applied to multiple fields, for performance and extended use cases |
| Schema Custom Posts | Query Custom Post Types |
| Schema Posts | Query posts, through type Post added to the schema |
| Schema Pages | Query pages, through type Page added to the schema |
| Schema Users | Query users, through type User added to the schema |
| Schema User Roles | Query user roles, through type UserRole added to the schema |
| Schema User Avatars | Query user avatars, through type UserAvatar added to the schema |
| Schema Comments | Query comments, through type Comment added to the schema |
| Schema Tags | Base functionality for all tags |
| Schema Post Tags | Query post tags, through type PostTag added to the schema |
| Schema Categories | Base functionality for all categories |
| Schema Post Categories | Query post categories, through type PostCategory added to the schema |
| Schema Media | Query media elements, through type Media added to the schema |
| Schema Custom Post Meta | Add the option field to custom posts, such as type Post |
| Schema User Meta | Add the option field to type User |
| Schema Comment Meta | Add the option field to type Comment |
| Schema Taxonomy Meta | Add the option field to taxonomies, such as types PostTag and PostCategory |
| Schema Menus | Query menus, through type Menu added to the schema |
| Schema Settings | Fetch settings from the site |
| Mutations | Modify data by executing mutations |
| Schema User State Mutations | Have the user log-in, and be able to perform mutations |
| Schema Custom Post Mutations | Base functionality to mutate custom posts |
| Schema Post Mutations | Execute mutations on podyd |
| Schema Custom Post Media Mutations | Execute mutations concerning media items on custom posts |
| Schema Post Media Mutations | Execute mutations concerning media items on posts |
| Schema Post Tag Mutations | Add tags to posts |
| Schema Post Category Mutations | Add categories to posts |
| Schema Comment Mutations | Create comments |
- YouTube video: Gato GraphQL demo
- Making GraphQL Work In WordPress
- Rendering the WordPress philosophy in GraphQL
- Comparing Gato GraphQL vs WPGraphQL
Architectural resources
Service container implementation:
Explanation of how the codebase is split into granular packages, to enable CMS-agnosticism:
- Abstracting WordPress Code To Reuse With Other CMSs: Concepts (Part 1)
- Abstracting WordPress Code To Reuse With Other CMSs: Implementation (Part 2)
Description of how the plugin is scoped:
Gato GraphQL is powered by the CMS-agnostic GraphQL server GraphQL by PoP.
Technical information on how the GraphQL server works:
Description of how a GraphQL server using server-side components works:
These articles explain the concepts, design and implementation of GraphQL by PoP:
- Designing a GraphQL server for optimal performance
- Simplifying the GraphQL data model
- Schema-first vs code-first development in GraphQL
- Speeding-up changes to the GraphQL schema
- Versioning fields in GraphQL
- GraphQL directives are underrated
- Treating GraphQL directives as middleware
- Creating an @export GraphQL directive
- Adding directives to the schema in code-first GraphQL servers
- Coding a GraphQL server in JavaScript vs. WordPress
- Supporting opt-in nested mutations in GraphQL
- HTTP caching in GraphQL
These articles explain the integration with Gutenberg (the WordPress editor).
To check the coding standards via PHP CodeSniffer, run:
composer check-styleTo automatically fix issues, run:
composer fix-style- 18.0 (current)
- 17.1
- 17.0
- 16.1
- 16.0
- 15.3
- 15.2
- 15.1
- 15.0
- 14.0
- 13.2
- 13.1
- 13.0
- 12.2
- 12.1
- 12.0
- 11.3
- 11.2
- 11.2
- 11.1
- 11.0
- 10.5
- 10.4
- 10.3
- 10.2
- 10.1
- 10.0
- 9.0
- 8.0
- 7.0
- 6.0
- 5.0
- 4.2
- 4.1
- 4.0
- 3.0
- 2.6
- 2.5
- 2.4
- 2.3
- 2.2
- 2.1
- 2.0
- 1.5
- 1.4
- 1.3
- 1.2
- 1.1
- 1.0
- 0.10
- 0.9
- 0.8
- 0.7
- 0.6
Please see CHANGELOG for more information on what has changed recently.
To execute PHPUnit, run:
composer testTo execute PHPStan, run:
composer analyseTo report a bug or request a new feature please do it on the GatoGraphQL monorepo issue tracker.
We welcome contributions for this package on the GatoGraphQL monorepo (where the source code for this package is hosted).
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email leo@getpop.org instead of using the issue tracker.
GPLv2 or later. Please see License File for more information.

