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

Geometry Scalar should expect a WKT or a Geometry Object. #10667

Open
olmohake opened this issue Jan 29, 2025 · 2 comments
Open

Geometry Scalar should expect a WKT or a Geometry Object. #10667

olmohake opened this issue Jan 29, 2025 · 2 comments
Labels
c/v3-ndc-postgres Data connector for PostgreSQL k/enhancement New feature or improve an existing feature

Comments

@olmohake
Copy link

Component

c/v3-engine

Is your proposal related to a problem?

At the moment it's necessary to stringify the geometry object.

query find($Geometry:Geometry!){
   postcode(where:{geometry:{st_contains:$Geometry}}){
      number
   }
}
{
  "Geometry": "{\"type\":\"Point\",\"coordinates\":[391968,5818620],\"crs\":{\"type\":\"name\",\"properties\":{\"name\":\"EPSG:25833\"}}}"
}

Describe the solution you'd like

Geometry should be a Object instead of a Scalar. This would not only align with the way geometry inputs work but also enable the graphql engine and ui tools like houdini to check the validity of the input in advance. i.e. disallow geometries with an invalid type property.

query find($Geometry:Geometry!){
   postcode(where:{geometry:{st_contains:$Geometry}}){
      number
   }
}
{
  "Geometry": {
    "type": "Point",
    "coordinates": [
      391968,
      5818620
    ],
    "crs": {
      "type": "name",
      "properties": {
        "name": "EPSG:25833"
      }
    }
  }
}

Describe alternatives you've considered

@olmohake olmohake added the k/enhancement New feature or improve an existing feature label Jan 29, 2025
@robertjdominguez robertjdominguez added the c/v3-ndc-postgres Data connector for PostgreSQL label Jan 29, 2025
@robertjdominguez
Copy link
Contributor

Thanks, @olmohake 👍

I've tagged the team responsible for this.

@olmohake
Copy link
Author

Thanks! Just realised turning the Geometry type itself from Scalar to Object, might create other problems down the road as you'd loose support for WKT formatted geometries.

Best way forward would probably be to keep the Scalar and enable users to pass in a Geometry Object or WKT formatted Geometries.

I adjusted the title of the issue accordingly.

@olmohake olmohake changed the title Geometry should be an Object instead of a Scalar Geometry Scalar should expect a WKT or a Geometry Object. Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/v3-ndc-postgres Data connector for PostgreSQL k/enhancement New feature or improve an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants