question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[gatsby-source-wordpress] null value from ACF field using Wordpress source

See original GitHub issue

Description

An ACF file field ‘fichier’ has a inconsistent behavior, the field is sometimes null, but no way to predict when or which one (see screenshots). Maybe the field doesn’t get the data from WordPress at first launch but is filled when wordpress update the post, which updates the Gatsby data.

Wordpress:

  • WP Gatsby Version 1.0.1
  • WP GraphQL Version 1.1.5
  • WPGraphQL for Advanced Custom Fields Version 0.4.0

Gatsby:

  • “gatsby-source-wordpress”: “^4.0.1”,

My basic gatsby config:

{
  resolve: "gatsby-source-wordpress",
  options: {
    url: "https://xxxxxxxxx/graphql",
  },
},

If I force update the fields on the wordpress editor with the same value, while gatsby dev is running, the field gets finally filled on the Gatsby side.

image image

Steps to reproduce

  • Setup similar ACF fields.
  • Run gatsby develop

Expected result

File should be filled with proper data.

Actual result

File is null.

Environment

  System:
    OS: Linux 5.9 Debian GNU/Linux 10 (buster) 10 (buster)
    CPU: (4) x64 Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz
    Shell: 5.7.1 - /usr/bin/zsh
  Binaries:
    Node: 14.15.5 - /tmp/yarn--1613425950823-0.6922920903973984/node
    Yarn: 1.22.5 - /tmp/yarn--1613425950823-0.6922920903973984/yarn
    npm: 6.14.11 - /usr/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Firefox: 78.7.0esr
  npmPackages:
    gatsby: ^2.32.3 => 2.32.3 
    gatsby-image: ^2.11.0 => 2.11.0 
    gatsby-plugin-manifest: ^2.12.0 => 2.12.0 
    gatsby-plugin-react-helmet: ^3.10.0 => 3.10.0 
    gatsby-plugin-robots-txt: ^1.5.5 => 1.5.5 
    gatsby-plugin-sass: ^3.2.0 => 3.2.0 
    gatsby-plugin-sharp: ^2.14.1 => 2.14.1 
    gatsby-plugin-sitemap: ^2.12.0 => 2.12.0 
    gatsby-source-filesystem: ^2.11.0 => 2.11.0 
    gatsby-source-wordpress: ^4.0.1 => 4.0.1 
    gatsby-transformer-sharp: ^2.12.0 => 2.12.0 

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
TylerBarnescommented, Apr 13, 2021

@jooola we’ll use the info from this issue there as well, thanks for providing so much good info about the issue. We closed this one in favour of that one because we had also closed another issue in favour of that one (trying to prevent hopping through a chain of issues). Thanks again!

0reactions
jooolacommented, Apr 13, 2021

Ok, I feel this ticket is more advanced/broad than the new one #30755. I guess we will continue over there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby source WordPress with ACF null field errors in build ...
Found the culprit, after re-installing/updating all gatsby plugis I found that I just had another page which didn't have any custom fields ......
Read more >
ACF image field returning null - WordPress.org
Acf image field is returning null in GraphiQl provided by WP Gatsby (i.e http://localhost:8000/___graphql) where as GraphiQl in wp backend provided by WP ......
Read more >
gatsby-source-wordpress
ACF returns false in cases where there is no data to be returned. This can cause conflicting data types in GraphQL and often...
Read more >
Using New Gatsby Source WordPress Plugin - CSS-Tricks
In my previous article, I discussed how I learned to create a decoupled WordPress powered Gatsby site using the Gatsby Source WPGraphQL ...
Read more >
WPGraphQL for Advanced Custom Fields
Interact with your Advanced Custom Field data using GraphQL Queries ... WPGraphQL for Advanced Custom Fields is a FREE open-source WordPress plugin.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found