Coerce Polygon Coordinates Object into an Array

Report a GraphQL Bug

What edition and version of Dgraph are you using?

Edition:

  • SlashGraphQL
  • Dgraph (community edition/Dgraph Cloud)

Have you tried reproducing the issue with the latest release?

N/A

Steps to reproduce the issue (paste the query/schema if possible)

type Location {
  id: ID
  boundsBox: Polygon
}
mutation addLocation {
  addLocation(
    input: [{
      boundsBox:{
        coordinates:{
          points:[
            {longitude:-104.057879,latitude:42.479635}, 
            {longitude:-104.057879,latitude:45.94545}, 
            {longitude:-96.436589,latitude:42.479635}, 
            {longitude:-96.436589,latitude:45.94545},
            {longitude:-104.057879,latitude:42.479635} # close the polygon.
          ]
        }
      }
    }]
  ) {
    numUids
    location {
      id
    }
  }
}

Expected behaviour and actual result.

Expected: Coerce simple polygon coordinates into an array of coordinates

Actual Results: Internal Server Error - a panic was trapped. This indicates a bug in the GraphQL server. A stack trace was logged. Please let us know by filing an issue with the stack trace.

@pbassham, Thank you for working through this!

the problem in this particular example is that coordinates wants an array

so it should be

{ coordinates: [{ points }] }
1 Like

Hi @amaster507, above bug is fixed in below PR and merged in 20.11.1. But I guess we are still using 20.11 for slash.