gql-dart / ferry

Stream-based strongly typed GraphQL client for Dart
https://ferrygraphql.com/
MIT License
593 stars 113 forks source link

[Solved] failed due to: Deserializing to #561

Closed minhnguyenandpad closed 7 months ago

minhnguyenandpad commented 7 months ago

Here the scenario: When my BE team return an api with new status api but haven't released the schema yet. Then when I called Api. This error showed up.

failed due to: Deserializing to 'CAR_STATUS' failed due to: Invalid argument(s): BROKEN, #0 BuiltJsonSerializers._deserialize

Is there any way to handle them to avoid such bugs? This make my app crash.

Here is my setup

targets:
  $default:
    builders:
      ferry_generator|graphql_builder:
        enabled: true
        options:
          schema: my_car|lib/data/graphql/schema.graphql

      ferry_generator|serializer_builder:
        enabled: true
        options:
          schema: my_car|lib/data/graphql/schema.graphql
minhnguyenandpad commented 7 months ago

I see we can use global_enum_fallbacks or enum_fallbacks