Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL: Find event attendees GraphQL query #136

Open
schloerke opened this issue Jan 14, 2022 · 0 comments
Open

GraphQL: Find event attendees GraphQL query #136

schloerke opened this issue Jan 14, 2022 · 0 comments

Comments

@schloerke
Copy link
Collaborator

From our discussion earlier, came up with:

query($id: ID! = "103349942!chp", $first: Int = 2, $cursor: String = "NjgzMTA5MjAy") {
  event(id: $id) {
    id
    title
    dateTime
    going
    tickets(input:{after: $cursor, first: $first}) {
      pageInfo {
        hasNextPage
        endCursor
      }
      count
      edges {
        cursor
        node {
          user {
            name
            email
          }
        }
      }
    }
  }
}

Can test it out here: https://www.meetup.com/api/playground

I found the definition of the parameters I could supply by looking in the schema file that I found: https://github.com/rladies/meetupr/blob/d44a3c9bceaeefcdee81fbe5409a04986692fc37/inst/graphql/meetup-com-schema.json near line 8250.

The corresponding schema info states:

          {
            "name": "tickets",
            "description": "List of tickets",
            "args": [
              {
                "name": "input",
                "description": "Options for configuring a pagination",
                "type": {
                  "kind": "INPUT_OBJECT",
                  "name": "ConnectionInput",
                  "ofType": null
                },
                "defaultValue": null
              }
            ],
            "type": {
              "kind": "NON_NULL",
              "name": null,
              "ofType": {
                "kind": "OBJECT",
                "name": "EventTicketsConnection",
                "ofType": null
              }
            },
            "isDeprecated": false,
            "deprecationReason": null
          },

... which says tickets can take a input argument which of the ConnectionInput shape. This shape is https://www.meetup.com/api/schema#ConnectionInput which has the familiar after and first fields. (Knowing tickets could take a input ConnectionInput object was not publicly documented 😞 )

cc @benubah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant