Skip to content

Update of relationship properties via set operation does not work in update mutations #6981

@andreloeffelmann

Description

@andreloeffelmann

Describe the bug
When updating relationship properties via set operation within update mutations, it does not work.
The query returns with a valid response, but the properties are not updated.

Type definitions

type TypeCodePlaceholder @mutation(operations: [CREATE,UPDATE,DELETE]) @node @subscription(events: []) {
	id: String!
	values: [TypeCodeValue!]! @relationship (type: "TYPECODEPLACEHOLDER_HAS_TYPECODEVALUE", properties: "TypecodeplaceholderHasTypecodevalueProperties", direction: OUT, nestedOperations: [CREATE, UPDATE, DELETE, CONNECT, DISCONNECT], queryDirection: DIRECTED) @settable(onCreate: true, onUpdate: true)
}

type TypeCodeValue @mutation(operations: [CREATE,UPDATE,DELETE]) @node @subscription(events: []) {
	id: String!
}

type TypecodeplaceholderHasTypecodevalueProperties @relationshipProperties {
	order: Int!
}

To Reproduce
Steps to reproduce the behavior:

  1. insert a TypeCodePlaceholder with id= A
  2. insert two TypeCodeValues with id=B and id=C
  3. connect these with the TypeCodePlaceholder and set the relation property order to 1 for B and 2 for C
  4. Execute the following Mutation
mutation {
  updateTypeCodePlaceholders(
    where: { id: { eq: "A" } }
    update: {
      values: [
        {
          update: {
            where: { node: { id: { eq: "B" } } }
            edge: { order: { set: 2 }}
          }
        }
        {
          update: {
            where: { node: { id: { eq: "C" } } }
            edge: { order: { set: 1 }}
          }          
        }
        
      ]
    }
  ) {
    typeCodePlaceholders {
      valuesConnection {
        edges {
          properties {
            order
          }
          node {
            id
          }
        }
      }
    }
  }
}
  1. check the response:
{
  "data": {
    "updateTypeCodePlaceholders": {
      "typeCodePlaceholders": [
        {
          "valuesConnection": {
            "edges": [
              {
                "properties": {
                  "order": 1,
                },
                "node": {
                  "id": "B"
                }
              },
              {
                "properties": {
                  "order": 2
                },
                "node": {
                  "id": "C"
                }
              }
            ]
          }
        }
      ]
    }
  }
}
  1. The values for the order property have not been updated

System (please complete the following information):

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingconfirmedConfirmed bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions