wp-graphql / wpgraphql-acf

Re-architecture of WPGraphQL for ACF
GNU General Public License v3.0
91 stars 12 forks source link

User field returns empty UNLESS that user has authored a post #205

Closed theleewise closed 6 months ago

theleewise commented 6 months ago

I noticed that whenever I selected some users, the data would show in the graphql query but whenever other users were selected then it wouldn't show the data. After check all different settings, roles, etc. between the users it appears the only difference is users that have authored posts.

I took a user that didn't have any authored posts and was not showing in my graphql query and change 1 article to be authored by them and then the query started working.

Screenshot 2024-05-17 at 2 31 49 PM Screenshot 2024-05-17 at 2 32 41 PM

ACF Setup

jasonbahl commented 6 months ago

@theleewise this is working as expected.

Users in WordPress are not public unless they have authored something that is public.

You can read more about this here:

If you want to expose users as public entities we have some examples of how to do this:

theleewise commented 6 months ago

Thank you so much @jasonbahl! (sorry I didn't search thoroughly enough to find these myself)