Skip to content
This repository was archived by the owner on Jul 23, 2024. It is now read-only.
This repository was archived by the owner on Jul 23, 2024. It is now read-only.

Post meta values of 0 resolve to null for Number fields #164

@kellenmace

Description

@kellenmace

When I query an ACF Number field that has a post meta value of 0 in the database, the GraphQL API returns null for it.

Steps to reproduce:

  1. Register a Number ACF field on a post type
  2. Save one post with 5 (or any other number) as that field's value
  3. Save another post with 0 as that field's value
  4. Query for those two posts & field values via GraphQL and confirm that the values in the response are 5 and null, respectively.

Expected behavior

If the value of a Number field in the database is 0, then the value returning by the GraphQL API should also be 0.

Versions used for testing

WPGraphQL for Advanced Custom Fields 0.3.5
WPGraphQL 0.12.0
ACF Pro 5.5.11
WordPress 5.5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions