Basker Docs

Events, calendars, and ticketing

List events and performances, build a month calendar with from and to, and show booking status from the ticketing app

An event is a production, such as a concert or a play. An event instance is one performance of an event, with its own date, venue, and booking status. Use events for listings of productions, and eventInstances for calendars and dates.

List upcoming events

events returns events that have not finished, soonest first:

{
  events(limit: 10) {
    totalDocs
    docs {
      title
      path
      startDate
      endDate
      featuredImage { url(transform: { width: 600, format: webp }) alt }
      venue { title }
      season { title }
    }
  }
}

To read a past event, get it by slug or id, or list past performances with eventInstances.

Build a month calendar

eventInstances with from and to returns the performances that start in a date window. from includes past dates, so you can page back through earlier months.

query Calendar($from: String!, $to: String!, $venueId: ID, $page: Int) {
  eventInstances(from: $from, to: $to, venueId: $venueId, page: $page, limit: 100) {
    totalDocs
    hasNextPage
    docs {
      id
      startDate
      path
      venue { title }
      event { title path }
    }
  }
}
{
  "from": "2026-12-01T00:00:00.000Z",
  "to": "2027-01-01T00:00:00.000Z"
}
  • from matches performances that start on or after the date-time. to matches performances that start before it.
  • Without from, eventInstances returns performances from the start of today. Pass showPast: true to include earlier ones.
  • eventInstances sorts by start date. The default page size is 100 and the maximum is 500.
  • Filter by eventId, venueId, seriesId, or seasonId.
  • Hidden performances never appear.

A calendar in the browser sends one URL for each month and filter. Each URL caches at the edge, so the next visitor gets the cached response. Use the same date format for every request.

Show the dates of one event

Event.instances lists the performances of an event, soonest first:

query EventDates($slug: String!) {
  event(slug: $slug) {
    title
    instances(limit: 50) {
      docs {
        id
        startDate
        path
        venue { title }
      }
    }
  }
}

Venue.instances lists the performances at a venue. Both take showPast.

Show credits

Event.credits lists the people and organizations credited on an event, in the groups and order the editor entered:

query EventCredits($slug: String!) {
  event(slug: $slug) {
    title
    credits {
      group
      role
      person { name path }
      organization { title path }
    }
  }
}
{
  "data": {
    "event": {
      "title": "Season 2027 Opening Gala",
      "credits": [
        { "group": "Artists", "role": "Conductor", "person": { "name": "Ada Moreno", "path": "/people/ada-moreno" }, "organization": null },
        { "group": "Artists", "role": "Piano", "person": { "name": "Mina Okafor", "path": "/people/mina-okafor" }, "organization": null }
      ]
    }
  }
}

To list the events of a person or a work, use Person.events or Work.events. Event.people lists the credited people without roles.

Show booking status

EventInstance.ticketing gives the booking state of a performance. Basker uses the same rules as the booking buttons on a site that it renders.

query Availability($eventId: ID!) {
  eventInstances(eventId: $eventId) {
    docs {
      id
      startDate
      ticketing {
        provider
        status
        label
        bookingUrl
        quantityAvailable
        action { type href externalId }
      }
    }
  }
}
FieldDescription
providerThe ticketing system, for example spektrix or general.
statusonSale, comingSoon, soldOut, offSale, cancelled, or waitlist. null when nothing is reported.
labelThe button label that the editor or the ticketing system set, for example Book Now.
bookingUrlThe absolute URL of the booking page, or null.
quantityAvailableThe number of seats left, when the ticketing system syncs a count.
actionHow the booking button works: type is url, spektrix, tessitura, or elevent. externalId is the ID of the performance in the ticketing system, for embedding its booking widget.

bookingUrl and action.href are absolute URLs, so you can use them on any domain.

ticketing is null when the ticketing app of the performance is not installed on the site.

A response that selects ticketing caches at the edge for 60 seconds, not 300. Put ticketing in its own query to keep the rest of the page on the longer lifetime. See Caching.

Data from ticketing apps

EventInstance also has fields with the data that each ticketing app syncs, as JSON: spektrix, tessitura, elevent, ticketsolve, and lineup. Event has tixly and ticketsolve.

A field for an app returns null when the site has not installed that app. To see the installed apps, read site.apps:

{
  site {
    apps
  }
}

Prefer ticketing over the app fields. It gives one shape for every ticketing system.

On this page