BaseCMS GraphQL API
Documentation Home
  • Getting Started
  • Connecting to the API
  • Modifying Data
    • Introduction
    • Creating a redirect
    • Creating content
    • Modifying content
    • Scheduling content
  • Querying Data
    • Introduction
    • Retrieving a Company
    • Retrieving multiple Companies
    • Retrieving published content
Powered by GitBook
On this page
  1. Querying Data

Retrieving multiple Companies

The following example looks up the available companies from your BaseCMS instance.

To query content via the GraphQL API, utilize the allPublishedContent query.

query AllCompanies($input: AllPublishedContentQueryInput!) {
  allPublishedContent(input: $input) {
    pageInfo {
      hasNextPage
      endCursor
    }
    edges {
      node {
        id
        type
        name
        ... on ContentCompany {
          companyType 
          # ...
        }
      }
    }
  }
}
{
  "input": {
    "includeContentTypes": ["Company"]
  }
}
X-Tenant-Key: my_tenant_key
{
  "data": {
    "allPublishedContent": {
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "MjEwMjQwOTc"
      },
      "edges": [
        {
          "node": {
            "id": 21104816,
            "type": "company",
            "name": "FolderWorks by Navitor",
            "companyType": null
          }
        },
        {
          "node": {
            "id": 21083690,
            "type": "company",
            "name": "drupa",
            "companyType": "Unknown"
          }
        }
        # ...
      ]
    }
  }
}

PreviousRetrieving a CompanyNextRetrieving published content

Last updated 4 years ago