-
Notifications
You must be signed in to change notification settings - Fork 122
Add Explicit options for adding ACF Field Groups to the Schema #135
Comments
Looks good, definitely separating the 'display' logic of locations rules from the 'filtering' logic of what is/isn't added to the schema feels more correct |
when can we expect this to be implemented? |
Would love to see this happen 😃👍🏻 |
How's the development of this feature coming along? |
Not sure myself, but if you want a quick workaround take a look at #134 |
Any updates on this? |
@jasonbahl sorry for tagging you, but do you plan to complete it? It's a deal breaker for me to use new gatsby wordpress source and wp-graphql, because my WP admin dashboard build on top of location rules and users see only what they can add for specific pages/types/categories. So the separation from location rules is very important in my case. Thanks in advance. |
This comment has been minimized.
This comment has been minimized.
@supriome Just to say the 'workaround' solution I provided will still 'work'. It does have 2 caveats: (1) The acf field groups will appear on more objects than they should (2) You can't have 2 field groups with the same 'GraphQL name' |
@AbeCole Thanks again, I'll try this method on my next project. But for now, my solution is to get the data through REST API instead of using GraphQL |
I created a PR to handle this issue. |
Any updates on this? This issue seems to be a deal-breaker when it comes to building client projects. |
Fix #135. Add Explicit options for adding ACF Field Groups to the Schema
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
orPost 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:
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.
The text was updated successfully, but these errors were encountered: