+
Skip to content

GraphQL: Find event attendees GraphQL query #136

@schloerke

Description

@schloerke

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载