gql-dart / gql

Libraries supporting GraphQL in Dart
MIT License
268 stars 121 forks source link

OperationException(linkException: ResponseFormatException(originalException: type 'Null' is not a subtype of type 'String' in type cast #415

Open Routee opened 1 year ago

Routee commented 1 year ago

image

if the backend throw a custom exception which message is null. This line:

error['message'] as String

will throw an excption. it's not the expected.

knaeckeKami commented 1 year ago

Actually, a message is required by the graphql spec

See https://spec.graphql.org/October2021/#sec-Errors.Error-result-format