Back to Content Management API

schedules

Returns a list of schedules paginated by a cursor.

Arguments

  • Name
    after
    Type
    String
    Description

    Returns the elements that come after the specified cursor.

  • Name
    before
    Type
    String
    Description

    Returns the elements that come before the specified cursor.

  • Name
    first
    Type
    Int
    Description

    Returns up to the first n elements from the list.

  • Name
    last
    Type
    Int
    Description

    Returns up to the last n elements from the list.

Returns

  • Name
    SectionConnection.edges
    Type
    [ScheduleEdge!]!
    Description

    A list of edges.

  • Name
    SectionConnection.nodes
    Type
    [Schedule!]!
    Description

    A list of the nodes contained in ScheduleEdge.

  • Name
    SectionConnection.pageInfo
    Type
    PageInfo!
    Description

    Information to aid in pagination.

  • Name
    SectionConnection.totalCount
    Type
    Int
    Description

    The total count of items.

Request

import { PackClient } from '@pack/client'
const packClient = new PackClient({
  token: 'YOUR-PACK-TOKEN'
});

const query = `
query {
  schedules(first: 5) {
    edges {
      cursor
      node {
        id
        title
        description
      }
    }
  }
}
`
const variables = {
  first: 5
}
const response = await packClient.fetch(query, { variables: variables });
console.log(response.data);

Response

{
    "data": {
        "schedules": {
            "edges": [
                {
                    "cursor": "cursor",
                    "node": {
                        "id": "schedule-id",
                        "title": "Schedule Title",
                        "description": "Schedule Description"
                    }
                }
            ]
        }
    }
}

Was this page helpful?