-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[gatsby-source-wordpress] No Advanced Custom Fields (ACF) in GraphQL response #2394
[gatsby-source-wordpress] No Advanced Custom Fields (ACF) in GraphQL response #2394
Comments
Look at the using-wordpress site in the examples directory. Using
"childWordpressAcfField" doesn't always work and that form isn't
necessarily recommended. Also if you haven't, learn to explore your sites
schema in graphiql.
…On Sun, Oct 8, 2017, 12:39 PM Alex Muraro ***@***.***> wrote:
Hi,
I am trying build a Gatsby site by fetching data from WordPress.
ACF data seems to not be pulled.
I have a self hosted WordPress, I have set the "useACF: true" option .
If I understand correctly, I should now have access to
"childWordpressAcfField" from GraphQL.
However I do not see it appearing in the GraphQL UI, and trying to query
for it returns the error "Cannot query field "childWordpressAcfField" on
type "wordpress__POST"
Any idea?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2394>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEVhyejdtUEq_aa_8Uu9qAThNlNF-edks5sqPrNgaJpZM4Pxw9s>
.
|
Hi, thanks for your answer. I have been exploring the schema in graphiql quite a bit, and my problem is exactly that I don't see anything ACF related. if I do:
I get an error, "Cannot query field "acf" on type "wordpress__POST". I'm running out of ideas LOL :) |
Try installing the using-wordpress example site and poking around there. |
Ok, I've tried the demo and it's got the acf fields as expected. |
Do you have the acf-to-rest-api plugin installed on your site? |
Hi Emil, Yes I do, it's version 2.2.1 (latest). So weird! |
@akmur I am having similar issues with ACF and the wordpress-source plugin in general, do you have a repo for this project yet? Thinking of looking into it, which versions of ACF and Wordpress are you using as well? In addition, I found that upgrading to the latest version of the wordpress-source forces you to use the
Let me know if any of that helps 😃 |
Just to join in here I cannot get ACF query to work on allWordpressPage just says This is the query I tried (have also tried different variations):
Any help appreciated. |
I think I will setup a test wordpress website and will let you know, I will push the code to github too |
I had similiar problem. Do you guys use ACF as a plugin or do you include it in your theme functions.php ? It seems that including it in functions.php doesnt play well with acf-to-rest-api plugin (so its not related to gatsby-source-wordpress at all). If that's your setup then in functions.php manually init acf-to-rest-api plugin after including ACF:
Also first step would be inspecting wordpress api response (f.e /wp-json/wp/v2/posts) and see if results have acf field |
No, I use it as a plugin - and in my case the api response does have the custom fields, as I'm already using them through JavaScript |
Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help! |
Hi,
I am trying build a Gatsby site by fetching data from WordPress.
ACF data seems to not be pulled.
I have a self hosted WordPress, I have set the "useACF: true" option .
If I understand correctly, I should now have access to "childWordpressAcfField" from GraphQL.
However I do not see it appearing in the GraphQL UI, and trying to query for it returns the error "Cannot query field "childWordpressAcfField" on type "wordpress__POST"
Any idea?
The text was updated successfully, but these errors were encountered: