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

Explicit GraphQL input types for Point, Line, Polygon #3

Open
mattbretl opened this issue Mar 19, 2019 · 4 comments
Open

Explicit GraphQL input types for Point, Line, Polygon #3

mattbretl opened this issue Mar 19, 2019 · 4 comments

Comments

@mattbretl
Copy link
Collaborator

mattbretl commented Mar 19, 2019

Is there a benefit to using a single GraphQL input type (GeoJSON)? For web mapping purposes, you usually need to know whether you're dealing with points, lines, or polygons, so I would prefer to see GeoJSONPoint, GeoJSONLine, etc. exposed in the GraphQL schema.

@mattbretl mattbretl changed the title Explicit GraphQL types for Point, Line, Polygon Explicit GraphQL input types for Point, Line, Polygon Mar 19, 2019
@mattbretl
Copy link
Collaborator Author

Sorry, I conflated a few different issues here. This is only concerning Input types. (On the query side, you already have explicit types for each subtype, e.g. GeometryPoint.)

@benjie
Copy link
Member

benjie commented Mar 19, 2019

Nah, just simplicity - trivially easy to feed the GeoJSON to the DB. If they need different input types so be it 👍

@Rycochet
Copy link

Not sure if it's related (or just me doing something wrong, even if the code works) - but graphiql complains about the type on GeoJSON variables, so it's not trivial to check they're correctly formatted (I got a Polygon wrong by missing the extra nesting, and needed the backend error to notice etc):

{
  "point": {
    "type": "Point",
    "coordinates": [
      -1.232,
      51.660
    ]
  }
}

Screenshot 2019-03-21 at 08 57 17

@benjie
Copy link
Member

benjie commented Mar 21, 2019

GraphiQL doesn’t like the JSON scalar either.

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

3 participants