the-events-calendar / ql-events

The Events Calendar binding to WPGraphQL
16 stars 7 forks source link

Query for Saved Custom Ticket Fieldsets #34

Open craigwilcox opened 3 years ago

craigwilcox commented 3 years ago

In TEC admin area, it's possible to add and save custom fieldsets that can be used across multiple classes. An image of creating a fieldset from the admin area follows:

image

For each of the added custom ticket fieldsets, we need to obtain the following information:

  1. Title.
  2. Type. (Text, Radio, Checkbox, Dropdown, Email, Telephone, URL, Birth Date, Date).
  3. From each of the types, we need to be able to get the key-value pairs available, such as Label, Description, and Options for a Checkbox. Any field with returned lines needs to be exposed in a way we can parse the data accurately.

A sample query for a custom ticket field could look like this:

query CustomTicketsQuery {
 event (id: X, idType: databaseID) {
  wooTickets {
   customTicketFields {
   nodes {
    fieldType {
     Label
     Description
     Options
     Required
     }
    } 
   }
  }
 }
}

With this information, we will be able to create the necessary fields for each of the tickets.

Plugins Needed

Event Tickets (for Custom Ticket Fieldsets) Event Tickets Plus (for WooTickets integration)