Cap Collectif Developers - GraphQL API

Using Global Node IDs

Guessing the type

You can access most objects in Cap Collectif API (users, steps, contributions, etc.) using a single GraphQL query : node.

{
  node(id: "1234") {
    __typename
  }
}

Do a direct node lookup in GraphQL

Once you've confirmed the type, you can use an inline fragment to access the object by its ID and return additional data.
In this example, we define the fields on User that we'd like to query:
{
  node(id: "1234") {
    ... on User {
      username
      createdAt
    }
  }
}
This type of query is the standard approach for looking up an object by its global node ID.