Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore location rules when adding fields to the schema. Fixes #52. #82

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Conversation

peterjanes
Copy link

This hasn't obviously broken anything in my installation, but I haven't done exhaustive testing on it either.

@jasonbahl
Copy link
Contributor

@peterjanes I believe this will cause that filter to always return true, regardless of using within WPGraphQL or not.

Can you describe what this solves so we can make sure we're not filtering too heavily?

@peterjanes
Copy link
Author

peterjanes commented Oct 29, 2019

You're right, it does show all of the fields all the time. I'll figure out how to detect whether it's a query in GraphQL, or move it to a more appropriate place. (My original branch name was issue-52-naive, which was apt.)

The goal is to show all ACF fields in the schema, even if they have a location rule that only displays them on an admin screen when a particular condition is met. For example, I have a number of field groups that are only displayed when a post's category is set to a specific value, and I want to be able to query them when I display that post.

[edit: just noticed that "fixes #52" in the description doesn't link to #52, so I'll do that here.]

peterjanes and others added 22 commits October 29, 2019 12:28
Fixed allowed post type check
…ut-causes-issues

#91 - Don't add flex fields to the Schema if there are no layouts configured
Implement graphql_field_name for fields
#93 - apply autop and nl2br on textarea fields depending on their formatting selection
Support fields for Google Maps field added in ACF 5.8.6
- Update Composer dependencies
@stephanedemotte
Copy link

+1 for this one,

With

  ->setLocation('post_type', '==', 'page')

It's ok.

But with

  ->setLocation('post_type', '==', 'page')
    ->and('page', '!=', $someID);

All my fields is never registered. We can't use the power of "set location"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants