Closed Davete0302 closed 2 years ago
this looks like a malformed query for your server, we don't attach any operation name. However, without an example of stacktrace and query, it is not possible to help.
I can't see the logs/stacktrace from backend. Is there a way to see the actual request sent? Would be really helpful.
Request
Query(
options: QueryOptions(
document: gql(DashboardGraphQL.accountDetailsQuery),
operationName: 'accountDetails'
),
builder: (QueryResult result,
{VoidCallback refetch, FetchMore fetchMore}) {
Query
query AccountDetails {
accountDetails {
... on AccountDetails {
ibanList {
accountId
bicCode
iban
}
accountType
accountNumber
accountNumberShort
accountId
ruid
companyId
accountDataOpened
email
mobile
baseCurrency
balanceInBaseCurrency
lastTransactionDate
}
... on ResponseErrors {
errors {
message
code
displayMessage
... on InternalError {
message
code
displayMessage
context
}
}
}
}
}
Response
OperationException(linkException: ResponseFormatException(originalException: FormatException: Unexpected end of input (at character 1)
^
), graphqlErrors: [])
Maybe, you type from the operation name? https://graphql.org/learn/queries/#operation-name
and you have space also inside the operationName
string
This is not a client problem, but just a typo
Edited operationName, it was a typo it originally does not have space. Still the same issue though. Also Is there a way to see the actual request sent? Would be really helpful.
The operationName
it is the "query name" right? so in your case it is AccountDetails
right?
actual request sent
You should implement a custom link
Yes, actually tried both 'AccountDetails' and 'accountDetails'. Also please answer this. 'Is there a way to see the actual request sent?' It's ok if there's none. Tested with 3 different request both with correct operationName, one worked and 2 did not. So I'm wondering what request was sent. Alright will try to implement custom link.
Also please answer this. 'Is there a way to see the actual request sent?' It's ok if there's none.
You should implement a custom link (here)
Closing for inactivity! please feel free to reopen this
When sending a request to the server operationName is missing from request, even after adding operationName in query constructor, is this expected? Also an additional question. is there a way to show in the actual query/request sent?