Closed Davete0302 closed 2 years ago
Previously I was using graphql version 3.1.0 and it was working fine, able to receive request as expected, but recently I had to update my flutter version to 2.10.3 and all other packages, including graphql.
Welcome to the present.
Try to look in the migrate guide https://github.com/zino-hofmann/graphql-flutter/blob/main/changelog-v3-v4.md this will solve your problem!
In addition, your query needs to contain __typename
as described in the example https://github.com/zino-hofmann/graphql-flutter/blob/main/packages/graphql/README.md#query
@vincenzopalazzo Already followed the migration guide documentNode: gql(...) is now document: gql(...) added __typename Remove uri in httpLink
Expected Response
{
"data": {
"balanceList": {
"data": [
{
"__typename": "Balance",
"currency": "GBP",
"amount": 1000,
"pendingAmount": 199,
"holdAmount": 0,
"availableBalance": 801
},
{
"__typename": "Balance",
"currency": "EUR",
"amount": 1000000,
"pendingAmount": 653,
"holdAmount": 0,
"availableBalance": 999347
}
]
}
}
}
Query
query BalanceList {
balanceList {
... on BalanceList {
data {
__typename
currency
amount
pendingAmount
holdAmount
availableBalance
}
}
... on ResponseErrors {
errors {
__typename
message
code
displayMessage
... on InternalError {
__typename
message
code
displayMessage
context
}
}
}
}
}
Maybe adding the stack trace can be helpful!
1
Previously I was using graphql version 3.1.0 and it was working fine, able to receive request as expected, but recently I had to update my flutter version to 2.10.3 and all other packages, including graphql.
Now I am using v.5.1.0 and I suddenly get this error.
Only changed the documentNode to document in Query. I built the request as per the documentation.
Also posted it here
main.dart
Graphql Repository
Client
Response