OpenBeta / openbeta-graphql

The open source rock climbing API
https://openbeta.io
GNU Affero General Public License v3.0
41 stars 32 forks source link

Can't set area left-right index #375

Closed vnugent closed 10 months ago

vnugent commented 10 months ago

updateAreasSortingOrder() returns duplicate key error on areas.metadata.leftRightIndex. Check API code and schema definitions.

Blocks https://github.com/OpenBeta/open-tacos/issues/1050

mutation MyMutation {
  updateAreasSortingOrder(input: [{areaId: "51a14351-bd92-5e20-a5cd-1310038d5afb", leftRightIndex: 0}])
}

output

{
  "errors": [
    {
      "message": "E11000 duplicate key error collection: openbeta.areas index: metadata.leftRightIndex_1 dup key: { metadata.leftRightIndex: 0 }",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "updateAreasSor