the-events-calendar / ql-events

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

Query for One Off Ticket Fieldsets #35

Open craigwilcox opened 3 years ago

craigwilcox commented 3 years ago

In https://github.com/the-events-calendar/ql-events/issues/34, the case presented was for an admin to create and save reusable custom ticket fieldsets.

It's also possible for an admin to create a one-off ticket fieldset that will be used only for this class and not saved for future use.

The query for this will be similar to the query in issue 34, except we need to get the one-off field in addition to any saved custom ticket fieldsets.

We just need these individual fieldsets to be differentiated from the saved custom ticket fieldsets. An example query for this could be:

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

In this query, I have only changed the name from customTicketFields to singleTicketFields. In almost all cases, these queries would be combined. If there's an easier way to get both of these queries put together, that would also be fine.

Plugins Needed

Event Tickets Plus (for WooTickets integration)

Thanks, Craig