Closed sirichards closed 4 years ago
I get this error in the value for a datetime field and return null.
@Hansanghyeon what error do you get? It looks like the image you tried to add doesn't exist.
@sirichards I'm unable to replicate this behavior.
I created an ACF Field Group with a Date Picker, DateTime Picker, and Time Picker, and saved a post with values.
I then query the Post in GraphQL, and get the values returned:
Can you provide more information so I can replicate?
Tested again. I have confirmed that the date field works without problems. Thank you. 🙏
Thanks for the follow-up @Hansanghyeon!
I, too, am having this issue but only in the Options.
Localhost GraphiQL
GUI GraphiQL
Options page
DB
WordPress 5.3.2 WP GraphQL 0.8.0 WPGraphQL for Advanced Custom Fields 0.3.1
@benleeth looking into this 👀
@jasonbahl, thanks!
@benleeth have a PR here (https://github.com/wp-graphql/wp-graphql-acf/pull/125) that I believe addresses this.
I have a test Post with a datetime field and a flex field with a datetime within it:
I also setup an options page similar to yours:
Below are the queries I tried:
Before
After
@benleeth this fix has been released in v0.3.2
@jasonbahl Thanks for this release of v0.3.2. I was initially having issue querying a date picker field with v0.3.1 as I always get an Internal Server Error. When I updated to v0.3.2, the error stopped but I still get a wrong date returned.
Here are my screenshots:
Any idea why i keep getting same date of 22/08/1970
?
I'm using WPGraphQL 0.4.1, I have also tried 0.8.3 but same behavior WPGraphQL ACF 0.3.2 ACF Pro 5.8.3 WordPress version: using 4.8.2 before when I got that behavior, upgraded to 5.4 and still same issue.
gah!
I'll see what I can find out.
@jasonbahl any update on this ?
@stephanedemotte try v0.3.3
https://github.com/wp-graphql/wp-graphql-acf/releases/tag/v0.3.3
I'm sorry to revive an old thread but I wanted to contribute my bug since this is one of the first google results
in the ACF php definition we had this
'return_format' => 'YYYY-MM-DD'
which was causing the field to always return null
I changed it to 'return_format' => 'Y-m-d', and it fixed the issue
Hey,
I have an issue where ACF date time picker fields are returned as null in GraphQL.
Data comes through in the rest API.
Could be related to #18