-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Confused about API.swift
generated file
#2768
Comments
Hi @cosimtaiuz That's an unfortunate side effect of us supporting GraphQL via both AppSync and Amplify. API.swift As you note, this file supports the AppSync SDK. It is generated by:
AmplifyModels.swift The If you are using Amplify API or DataStore, you can answer "No" to the CLI question "Do you want to generate code for your newly created GraphQL API" and it will not generate the API.swift file. As you note, you can also simply remove it and it will not affect anything in your Amplify app. Hope this helps. |
Transferred this to the doc repo so we can improve our documentation around this and prevent future confusion. Long-term, we should improve the CLI to detect and skip the AppSync flows unless the CLI detects that the project is using AppSync (or unless the customer explicitly opts in). |
Thanks for your reply @palpatim , good to know. |
Next steps
|
Hello,
I have setup my iOS project as outlined in the steps and it generated both some files in a folder called
AmplifyModels
and a file calledAPI.swift
which I noticed I could remove and the project worked just the same.I'm confused about this, which of the two generated things should I keep if I'm using Amplify? From my research it looks like the
API.swift
file is generated if I'm using AppSync directly, but since I'm not why was it?Thanks!
The text was updated successfully, but these errors were encountered: