aws-amplify / amplify-codegen

Amplify Codegen is a JavaScript toolkit library for frontend and mobile developers building Amplify applications.
Apache License 2.0
59 stars 57 forks source link

fix(amplify-codegen): fix for non-model decoding in flutter v1 #843

Closed Equartey closed 1 month ago

Equartey commented 1 month ago

Description of changes

Added the dropped Flutter V1 Model.fromJson() decoding logic back to non-model embeds. Customer observed embedded non-model types not populating values after requests were made. This adds a fallback to previous logic.

Issue #, if available

https://github.com/aws-amplify/amplify-flutter/issues/4872

Description of how you validated changes

Validated decoding against this schema in both Flutter V1 and V2.

type MyModel @model @auth(rules: [{ allow: owner }]) {
  id: ID!
  owner: String
  token: Token
  tokens: [Token]
}

type Token {
  externalId: String!
  value: String!
}

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.