phacks / gatsby-source-meetup

Source plugin for pulling Meetup.com Group and Events data into Gatsby.
https://www.gatsbyjs.org/packages/gatsby-source-meetup/
11 stars 7 forks source link

Query for events when the group has no events causes build error #7

Open brandonheck opened 4 years ago

brandonheck commented 4 years ago

When gatsby-source-meetup is configured to retrieve upcoming events and there are no upcoming events scheduled, the query for the events fails. I am using a StaticQuery, and this results in the build of my page failing.

Query:

export default () => (
    <StaticQuery
    query={graphql`
    query {
      meetupGroup {
      events {
        name
        local_date
        local_time
        venue {
          name
          address_1
          city
        }
        link
        description
      }
    }
  }
  `}
  render={
    // formatting stuff for the page here
  )}/>
)

Exception (local, using gatsby develop):

 ERROR #85907  GRAPHQL

There was an error in your GraphQL query:

- Unknown field 'events' on type 'MeetupGroup'.