WPGraphQL Integration

The WPGraphQL integration allows Pods content types and their fields to be discoverable by the WPGraphQL plugin.

The initial integration for WPGraphQL has been merged into Pods 2.9 from the WPGraphQL Integration Add-On for Pods Pro by SKCDEV. The Add-On itself will continue to be developed with new features that are focused on Advanced Content Types and other enhancements in the future that will still remain outside of Pods core.

Requirements

Requires WPGraphQL 1.1.3+ in order to show any of the WPGraphQL settings for Pods, Fields, or the Pods Settings page.

Demo video

The below video provides a great overview of the WPGraphQL integration and what it does. It talks about the Add-On from Pods Pro by SKCDEV but the same thing applies to the integration now in Pods core (since Pods 2.9).

What does this integration do?

This integration provides context to the WPGraphQL plugin so that it can become aware of certain Pods-created Content Types and Custom Fields created with Pods.

Supported Content Types in Pods

  • Post Types
  • Taxonomies
  • Users
  • Media
  • Comment

Getting started

Turn on the “Enable support in WPGraphQL” from the Edit Pod screen under the “WPGraphQL” tab.

Custom WPGraphQL names

You can define custom names to use in WPGraphQL instead of the plural/singular name you may already be using. It should be in the camelCase format with no special characters. These will be used to refer to the post type inside of GraphQL queries.

Relationship / File Formats

There are a few options available for each Relationship and File field. You can specify in the pod settings what to use for all of them or rely on per-field settings.

  • Use per-field setting
  • Connection (you can drill down through GraphQL to get whatever field(s) you would like!)
  • ID only
  • Title only
  • View (or Asset) URL only

Field options

You can customize per-field how they will work with WPGraphQL.

Other Helpful Documentation on Code Reference

Action Hook Reference

Field Functions

Field handling with Pods

Filter Reference

General Functions

Media Functions

Media handling functions in Pods

Pods Blocks API

Pods 2.8 introduces a new API for creating blocks with PHP.

Pods DFV JS API

The DFV JS API allows you to interact with the forms that Pods displays.

Pods REST API Endpoints

The Pods Admin REST API Endpoints for managing configurations.

Pods WP-CLI Commands

How to use the Pods CLI to access wp pods and wp pods api

pods_api()

We are working hard on our new code reference site. Until then this section will remain unavailable. Thank you for your patience.

pods_ui()

Easily create content admin screens with in-depth customization.

pods()

Set up the Pods class object for a specific pod.

Registering Configurations

Registering Configurations with Pods is possible through file-based or code-based registration.