the-events-calendar / ql-events

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

Events WooTickets not returning correct tickets #43

Closed craigwilcox closed 1 year ago

craigwilcox commented 2 years ago

For our events, we query like the following to get the specific ticket associated with an event:

query MyQuery {
events {
  nodes {
    title
    wooTickets {
      nodes {
        name
      }
    }
  }
}
}

This returns data like the following:

{
  "data": {
    "events": {
      "nodes": [
        {
          "title": "Kimberbell Club: Faberge Cutwork Egg – 03/25/22 Colorado Springs",
          "wooTickets": {
            "nodes": [
              {
                "name": "Kimberbell Club: Faberge Cutwork Egg - 03/25/22 Colorado Springs"
              }
            ]
          }
        },

After upgrading to WPGraphQL 1.6+, this same query now gets the latest tickets created instead of the tickets for this specific class. Returned data looks like this now:

  "data": {
    "events": {
      "nodes": [
        {
          "title": "Kimberbell Club: Faberge Cutwork Egg – 03/25/22 Colorado Springs",
          "wooTickets": {
            "nodes": [
              {
                "name": "April Sew Fun - 04/22/22 Colorado Springs"
              },
              {
                "name": "April Sew Fun - 04/21/22 Arvada"
              },
              {
                "name": "April Sew Fun Snapshot - 04/20/22 Littleton"
              },
              {
                "name": "April Sew Fun Snapshot - 04/19/22 Aurora"
              },
              {
                "name": "Open Sew with Terry - 03/17/22 Littleton"
              },
              {
                "name": "Open Sew with Terry - 04/21/22 Littleton"
              },
              {
                "name": "Open Sew with Terry - 04/21/22 Littleton"
              },
              {
                "name": "Block of the Month: Arcadia Avenue - 04/21/22 Littleton"
              },
              {
                "name": "Block of the Month: Morris Medley - 04/14/22 PM Littleton"
              },
              {
                "name": "Block of the Month: Morris Medley - 04/14/22 Littleton"
              }
            ]
          }
        },

We need to make sure we can get the right WooTicket for each event.

Thanks, Craig