rladies / meetupr

R interface to the meetup.com API
https://rladies.github.io/meetupr
MIT License
76 stars 25 forks source link

GraphQL: Groups needs followup query for location information #129

Open schloerke opened 2 years ago

schloerke commented 2 years ago

Related: #128

The current country code is a two letter code and is not pretty. Currently there is no location field.

Ex:

 $ :List of 16
  ..$ id                : chr "35447775"
  ..$ name              : chr "R-Ladies Caracas"
  ..$ urlname           : chr "rladies-caracas"
  ..$ latitude          : num 10.5
  ..$ longitude         : num -66.9
  ..$ city              : chr "Caracas"
  ..$ state             : chr ""
  ..$ country           : chr "ve"
  ..$ membershipMetadata: NULL
  ..$ memberships       :List of 1
  .. ..$ count: int 9
  ..$ foundedDate       : chr "2021-06-21T10:59:21-04:00"
  ..$ timezone          : chr "America/Caracas"
  ..$ joinMode          : chr "OPEN"
  ..$ who               : chr "R-Ladies"
  ..$ isPrivate         : logi FALSE
  ..$ category          :List of 2
  .. ..$ id  : chr "546"
  .. ..$ name: chr "Technology"

Given each pair of lat / lon values, location can be queried.


Example query:

query location($lat: Float = 10.5, $lon: Float = -66.9) {
  findLocation(lat: $lat, lon: $lon) {
    lat
    lon
    city
    localized_country_name
    name_string
  }
}

Search results will return an array.

{
  "data": {
    "findLocation": [
      {
        "lat": 10.5,
        "lon": -66.85,
        "city": "Chacao",
        "localized_country_name": "Venezuela",
        "name_string": "Chacao, Venezuela"
      },
      {
        "lat": 10.54,
        "lon": -66.93,
        "city": "Caracas",
        "localized_country_name": "Venezuela",
        "name_string": "Caracas, Venezuela"
      },
      {
        "lat": 10.52,
        "lon": -66.84,
        "city": "Los Dos Caminos",
        "localized_country_name": "Venezuela",
        "name_string": "Los Dos Caminos, Venezuela"
      },
      {
        "lat": 10.52,
        "lon": -66.83,
        "city": "Petare",
        "localized_country_name": "Venezuela",
        "name_string": "Petare, Venezuela"
      },
      {
        "lat": 10.43,
        "lon": -66.88,
        "city": "Baruta",
        "localized_country_name": "Venezuela",
        "name_string": "Baruta, Venezuela"
      }
    ]
  }
}

Matching logic:

schloerke commented 2 years ago

The country name, similar to localized_country_name above, has been implemented in #128.

If this is good enough, we can close this issue.