Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Swift - Generate schema for non-models containing models correctly #619

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MorFix
Copy link

@MorFix MorFix commented Jul 12, 2023

Description of changes

If a schema contains non-models types that contain models, they're not generated correctly in Swift, because of a missing label, and the code doesn't compile.
That scenario can happen if you have a custom resolver that returns a model along with other things.

Issue #, if available

-N/A-

Description of how you validated changes

  • Added test
  • Generated models locally

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Changes are tested using sample applications for all relevant platforms (iOS/android/flutter/Javascript) that use the feature added/modified

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

@MorFix MorFix marked this pull request as ready for review July 12, 2023 16:17
@MorFix MorFix requested a review from a team as a code owner July 12, 2023 16:17
@dpilch
Copy link
Contributor

dpilch commented Sep 26, 2023

Thanks for the contribution @MorFix. Could you also add this test schema here: https://github.com/aws-amplify/amplify-category-api/blob/main/packages/amplify-graphql-schema-test-library/src/index.ts#L39

This will add this schema to our E2E tests that will test for successful compilation of the generated models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants