0

i want to use schema stitching, but i have problem with mutation extend, maybe with passing argument.

my following code for schema stitching

extend type Mutation {
space(value: SpaceInput): Int! @delegate(schema: "matterport", path: "space(value: $arguments:value)")
}

and i get following error

{
  "errors": [
    {
      "message": "The variable `__arguments_value` is not compatible with the type of the current location.",
      "locations": [
        {
          "line": 2,
          "column": 5
        }
      ],
      "path": [
        "space"
      ],
      "extensions": {
        "variable": "__arguments_value",
        "variableType": "SpaceInput",
        "locationType": "SpaceInput!",
        "specifiedBy": "http://spec.graphql.org/October2021/#sec-All-Variable-Usages-are-Allowed",
        "remote": {
          "message": "The variable `__arguments_value` is not compatible with the type of the current location.",
          "path": [
            "space"
          ],
          "extensions": {
            "variable": "__arguments_value",
            "variableType": "SpaceInput",
            "locationType": "SpaceInput!",
            "specifiedBy": "http://spec.graphql.org/October2021/#sec-All-Variable-Usages-are-Allowed"
          }
        },
        "schemaName": "matterport"
      }
    }
  ]
}

Can you help me

I am trying multiple passing argument but i get same result as i describe in error.

1 Answers1

0

As I can see by your error response, your extension doesn't work because of nullability. Your space in the extension takes nullable argument while space in the delegate takes non-nullable one

I made such a conclusion by this part of response:

    {
      "errors": [
        {
          "extensions": {
            "variableType": "SpaceInput",
            "locationType": "SpaceInput!",
            "specifiedBy": "http://spec.graphql.org/October2021/#sec-All-Variable-Usages-are-Allowed"
            }
          }
        }
      ]
    }

Variable type doesn't have ! in the end and it's mean that type is non-nullable. Such a difference can be cause of an incompatibility. It also mentioned in the specification that linked in the specifiedBy field:

AreTypesCompatible(variableType, locationType):

  1. If locationType is a non-null type:

    a. If variableType is NOT a non-null type, return false.

Eugene
  • 169
  • 1
  • 6