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: Groups needs followup query for location information #129

Open
schloerke opened this issue Dec 29, 2021 · 1 comment
Open

GraphQL: Groups needs followup query for location information #129

schloerke opened this issue Dec 29, 2021 · 1 comment

Comments

@schloerke
Copy link
Collaborator

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:

  • Use first match that has the same city value
  • If no exact match is found, use first result.
@schloerke
Copy link
Collaborator Author

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

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

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