Explicit GraphQL input types for Point, Line, Polygon
mattbretl opened this issue · comments
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.
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.)
Nah, just simplicity - trivially easy to feed the GeoJSON to the DB. If they need different input types so be it 👍
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
]
}
}
GraphiQL doesn’t like the JSON scalar either.