Azure API Management - variable types are invalid in arrays

Westermeier, Michael 5 Reputation points
2023-05-23T22:45:28.8566667+00:00

I have configured a GraphQL API on Azure API Management.

I perform a query to that GraphQL API and hand over dataTypes in arrays of string value types:

query GetDevicesData(
	$dataType: [String!]!){deviceData(dataType: $dataType,...)...}

values:

{
  "dataType":[
    "yield_out",
    "yield_in",
    "state"
  ]
}

Now, when I perform the query, I get an error from API Management that the variable is invalid because it cannot convert it to String.:

error:

"message": "Variable '$dataType[0]' is invalid. Unable to convert 'yield_out' to 'String'",
"locations": [
	{
		"line": 3,
        "column": 3
     }
],
"extensions": {
	"code": "INVALID_VALUE",
    "codes": [
    	"INVALID_VALUE",
        "INVALID_OPERATION"
     ],
     "number": "5.8"
}
   

I have tried a lot to solve the issue, but am completely lost now.

Thanks for your help

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,453 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Westermeier, Michael 5 Reputation points
    2023-05-25T08:36:55.97+00:00

    Hi @MuthuKumaranMurugaachari, thanks for your reply.

    Yes, the error is origination from the Azure API Management itself. The Request does not even reach our GraphQL Backend through the APIM serializer.

    We can reproduce with different clients and test-clients like Postman.

    Actually, we are already in direct, personal contact with one of your MS colleagues. He'll take care of the issue and post a final solution here at the end of investigation.

    BR, Michael

    1 person found this answer helpful.

  2. Ben Gimblett 4,560 Reputation points Microsoft Employee
    2023-05-29T15:17:50.53+00:00

    Thankyou Michael . APIM Service team have accepted the issue raised - they will look at a fix asap.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.