Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 731 Bytes

number.md

File metadata and controls

40 lines (30 loc) · 731 Bytes

Number Field

Number fields are added to the WPGraphQL Schema as a field with the Type Float.

Number fields can be queried, and a Float will be returned.

Here, we have a Number field named number on the Post Edit screen within the "ACF Docs" Field Group.

Number field in the Edit Post screen

This field can be Queried in GraphQL like so:

{
  post( id: "acf-example-test" idType: URI ) {
    acfDocs {
      number
    }
  }
}

and the results of the query would be:

{
  "data": {
    "post": {
       "acfDocs": {
         "number": 5
       }
    }
  }
}