Skip to content
This repository was archived by the owner on Jul 23, 2024. It is now read-only.
This repository was archived by the owner on Jul 23, 2024. It is now read-only.

Add Explicit options for adding ACF Field Groups to the Schema #135

@jasonbahl

Description

@jasonbahl

Currently, the way WPGraphQL for ACF implicitly maps field groups from ACF Location Rules to the WPGraphQL Schema causes a lot of confusion.

ACF has a lot of location rules that require specific run-time context that's not available for Schema generation.

For example, rules such as Page is not equal to Home or Post is equal to Hello World don't exactly map well to a Schema.

The Schema is representative of all Types available, and context such as whether a Page is the Home Page, or a Post is the "Hello World" post is runtime context.

So, in an effort to reduce this confusion, I'm working on a more explicit setting where you can define the GraphQL Types to show the ACF Field Group on, and not rely on the location rules at all.

The location rules can be used for determining the editing experience, and the new setting can be used for determining explicitly which Types the field group should be available on in the Schema.

Something like the following:

Screen Shot 2020-04-20 at 1 56 00 PM

This checkbox field will show all Types that can have field groups associated with them. Post Types and Taxonomies that are exposed to GraphQL, Users, Comments, Menus, Menu Items, Media, Page Templates, etc.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions