4

I am trying to find out a way to fetch nearby events using GraphQL meetup.com API. After digging into the documentation for quite some time, I wasn't able to find a query that suits my needs. Furthermore, I wasn't able to find old, REST, documentation, where, the solution for my case might be present.

Thanks in advance !

2 Answers2

1

This is what I could figure out so far, the Documentation for SearchNode is missing, but I could get id's for events:

query($filter: SearchConnectionFilter!) {
    keywordSearch(filter: $filter) {
      count
      edges {
        cursor
        node {
          id
          
        }
      }
    }
  }

Input JSON:

{ "filter" : { 
    "query" : "party", 
    "lat" : 43.8, 
    "lon" : -79.4, "radius" : 100,
    "source" : "EVENTS" 
    }
}

Hope that helps. Trying to figure out this new GraphQL API

1

You can do something like this (customize it with whatever fields you want from Event):

const axios = require('axios');

const data = {
  query: `
query($filter: SearchConnectionFilter!) {
  keywordSearch(filter: $filter) {
    count
    edges {
      cursor
      node {
        id
        result {
          ... on Event {
            title
            eventUrl
            description
            dateTime
            going
          }
        }
      }
    }
  }
}`,
  variables: {
    filter: {
      query: "party",
      lat: 43.8,
      lon: -79.4,
      radius: 100,
      source: "EVENTS",
    },
  },
};

axios({
  method: "post",
  url: `https://api.meetup.com/gql`,
  headers: {
    Authorization: `Bearer YOUR_OAUTH_ACCESS_TOKEN`,
  },
  data,
})


nachocab
  • 13,328
  • 21
  • 91
  • 149