gql-dart / gql

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

Type exception in gql_websocket_link with decoding incoming messages. #455

Open temcewen opened 5 months ago

temcewen commented 5 months ago

Screenshot of error message with location it's occurring at: Untitled

The method signature expects a type of FutureOr<Map<String, dynamic>>? but the default function returns Map<String, dynamic>?. I believe the issue is that the FutureOr type is nullable, not its subtype.

Here is a screenshot of the default function:

Screenshot 2024-04-06 at 12 28 16 PM

I made a fix for it myself passing in a function that works as expected. I'll go ahead and make a pull request for it if that works.

catapop84 commented 3 months ago

From what I remember this error appears in dev mode in flutter, when hot reload is used. In production (release mode) this will not happen

spakanati commented 1 week ago

I would love to see your PR merged! Even if this issue doesn't affect production apps, not being able to hot-reload really hampers development.