The are currently using an ASP.Net Web Api as a gateway for our other graphql microservices. We are using Hot Chocolate 10.5.2 to stitch together all the schema definitions. Most of our schemas work fine; however, when we attempt to to stitch a multiple query schema it is not generating a consumable schema to the down stream microservice. This query works fine if we call the downstream microservice directly, but not with the stitched schema via the gateway api.
The query is below:
query getComments($pKId: String!, $exceptionId: String!, $exceptionType: String!, $exclusiveStartKey: PaginationInput)
{
comments: comments(commentData: {pKId: $pKId, minimum: 100, order: "Descending", exclusiveStartKey: $exclusiveStartKey})
{
rows: comments
{
commentId: sKId
userName: createdByName
subId: createdBySubId
comment: commentText
createdTimeStamp: createdTimeStamp
lastUpdatedTimeStamp: lastUpdatedTimeStamp
__typename
}
lastEvaluatedKey
{
pKId
sKId
__typename
}
__typename
}
exception: exceptions(exceptionData: {sKId: $exceptionId, exceptionType: $exceptionType, limit: 1})
{
detail: exceptions
{
commentCount: commentCount
__typename
}
__typename
}
}
From what I can tell the RemoteRequestDispatcher renames the query variables to __0__variablename
etc but it does not seem to be renaming the properties of the object being passed in even though the names are the same. This causes us to get the following error when it hits the downstream microservice:
"errors": [
{
"message": "The following variables were not used: __0__pKId, __0__exclusiveStartKey, __1__exceptionId, __1__exceptionType.",
"locations": [
{
"line": 1,
"column": 1
}
],
"extensions": {
"remote": "HotChocolate.Error",
"schemaName": "stockrecord"
}
},
{
"message": "The following variables were not declared: pKId, exclusiveStartKey, exceptionId, exceptionType.",
"locations": [
{
"line": 1,
"column": 1
}
],
"extensions": {
"remote": "HotChocolate.Error",
"schemaName": "stockrecord"
}
},
So the renamed variables show as not being used and the variables as part of the input object aren't declared due to the renaming.
I realize we could change how we pass in the variables but since this is a valid schema that works directly without stitching we would prefer not to have to change all our UI code.
Any help would be appreciated!