Home App Docs Blog Github

GraphQL startDate endDate

I am trying to get a list of Content Items of a specific type with the metadata about their published status so that I can either include or exclude items based on whether I’m in a production environment or pre-production (I want to include items regardless of startDate/endDate).

query {
  designerPage {
    name
    published
    startDate
    endDate
  }
}

is giving me the following output:

{
  "errors": [
    {
      "message": "Int cannot represent non 32-bit signed integer value: 1628611200000",
      "details": null
    }
  ],
  "data": {
    "designerPage": [
... items removed ...
      {
        "name": "Heluviee",
        "published": "published",
        "startDate": null,
        "endDate": null
      },

Content: Builder.io: Drag and drop page builder and CMS

I know that ‘Heluviee’ content item has a startDate and endDate, but it looks like they’re throwing an error being converted to numbers. How can I get this information reliably. Alternatively, can I use the content API and force it to include all items regardless of publishedStatus or start or end date?

Thanks for flagging @alex_lindsay_manime - we’ll have to resolve that GraphQL issue

In the meantime, try these parameters for the REST API (replace API_KEY with your public API key)

https://cdn.builder.io/api/v2/content/designer-page?apiKey=API_KEY&fields=startDate,endDate,published,name&query.published.$exists=true

basically by default we set query.published="published’, unless you override it. just setting query.published.$exists=true overrides to show any value that exists (one will always exist)