Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the iOS app’s data models (Amplify-generated) to include new backend fields and applies a deterministic display order for FAQ questions based on a new orderNum field.
Changes:
- Add
orderNumto the AmplifyQuestionmodel schema and struct. - Add
disabledto the AmplifyFeedingPointmodel schema and struct. - Update FAQ fetching to order questions by
orderNum(with unordered questions appended last).
Reviewed changes
Copilot reviewed 1 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| animeal/src/Flows/Main/Modules/More/Submodules/FAQ/Model/FAQModel.swift | Sorts fetched FAQ questions by orderNum before mapping to view models. |
| amplify/generated/models/Question+Schema.swift | Adds orderNum to the Amplify model schema. |
| amplify/generated/models/Question.swift | Adds orderNum property and initializer parameter to Question. |
| amplify/generated/models/FeedingPoint+Schema.swift | Adds disabled to the Amplify model schema. |
| amplify/generated/models/FeedingPoint.swift | Adds disabled property and initializer parameter to FeedingPoint. |
| amplify/generated/models/AmplifyModels.swift | Updates Amplify models version hash due to schema regeneration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
animeal/src/Flows/Main/Modules/More/Submodules/FAQ/Model/FAQModel.swift
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request overview
Regenerate Amplify models and integrate FAQ
orderNumfield with deterministic sortingProblem
The FAQ backend schema was updated to include a new optional field:
orderNum.However, the local iOS project did not reflect this change because the generated Amplify Swift models were outdated. As a result:
Questionmodel did not containorderNumRoot cause: Amplify models were not regenerated after schema updates, causing stale generated files in
amplify/generated/models.Summary
This PR regenerates Amplify models to reflect the updated backend schema and integrates the new
orderNumfield into the FAQ flow.Changes include:
AmplifyModelswith updated schema versionorderNumtoQuestionmodelQuestion+Schema.swiftto include the new fieldFeedingPointschema artifacts (auto-generated)orderNuminFAQModelAll non-FAQ file changes are auto-generated artifacts produced by running:
amplify codegen models
Changes
orderNum: Int?property.field(question.orderNum, is: .optional, ofType: .int)orderNumbefore mapping🧠 What happened (Root cause analysis)
During implementation of FAQ ordering:
orderNumschema.graphqlconfirmed the field existedamplify codegen modelsregenerated updated Swift modelsThis clarified the Amplify generation pipeline:
AWS AppSync Schema
↓
Local
schema.graphql↓
Generated Swift models (
amplify/generated/models)Models must be regenerated manually after schema updates.
How to test
1 open Animeal Studio platform
2. add or modify question with order number
3. build the app and open FAQ page