trompamusic / trompace-client

A python library to read from and write to the Trompa CE
Apache License 2.0
1 stars 0 forks source link

RequestControlAction mutation doesn't create the node in the correct form. #57

Closed aggelosgkiokas closed 3 years ago

aggelosgkiokas commented 3 years ago

After a RequestControlAction action mutation

mutation {
  RequestControlAction(
    controlAction: {
      potentialActionIdentifier: "60eed1af-c76c-411d-b967-576ff5d39bfa"
      entryPointIdentifier: "dbbb8baa-e6a0-4379-bd9b-eb34f51bb501"
      propertyObject: [
        {
          nodeIdentifier: "598f1083-700e-42e4-bc87-a95a925badae"
          potentialActionPropertyIdentifier: "33331ddb-863f-45c5-a554-bff7f47a9eef"
          nodeType: DigitalDocument
        }
      ]
      propertyValueObject: [
        {
          value: "value1"
          potentialActionPropertyValueSpecificationIdentifier: "b0f007b3-e111-42fd-962f-1ea89f559c95"
          valuePattern: String
        }
        {
          value: "value2"
          potentialActionPropertyValueSpecificationIdentifier: "adc50d59-0c9d-4d17-bcdb-cdce52d93f95"
          valuePattern: String
        }
      ]
    }
  ) {
    identifier
  }
}

Response:

{
  "data": {
    "RequestControlAction": {
      "identifier": "f8e79c50-b747-4626-a577-4c4a107c339e"
    }
  }
}

If we query the ControlActionObject:

  query {
        ControlAction(identifier: "f8e79c50-b747-4626-a577-4c4a107c339e") {
            actionStatus
            identifier
            object {
              identifier
              __typename
            }
        }
    }

then the list of items of the object list are all returned as PropertyValue objects, and not as PropertyValue and Property as requested by the mutation above.

{
  "data": {
    "ControlAction": [
      {
        "actionStatus": "PotentialActionStatus",
        "identifier": "f8e79c50-b747-4626-a577-4c4a107c339e",
        "object": [
          {
            "identifier": "a37a9483-9804-4990-9c4b-953952c095fc",
            "__typename": "PropertyValue"
          },
          {
            "identifier": "2386c2e3-9438-4727-ad11-a3b7e0ea02af",
            "__typename": "PropertyValue"
          },
          {
            "identifier": "0c08c536-4ddc-42fa-ae98-0f45effdff41",
            "__typename": "PropertyValue"
          }
        ]
      }
    ]
  }
}

The work can be still done, but if we want to be consistent with the documentation this should be fixed.