Amplify.API.mutate or AWSAppSyncClient ?
See original GitHub issueIs your feature request related to a problem? Please describe.
The documentation here: https://aws-amplify.github.io/docs/ios/start
show using Amplify.API to access an API.
The document here: https://aws-amplify.github.io/docs/cli-toolchain/graphql
shows using AWSAppSyncClient
The two aren’t compatible as pod versions conflict. Podfile
use_frameworks!
# Pods for nike-athlete-ios
pod 'amplify-tools'
pod 'Amplify'
pod 'AWSPluginsCore'
pod 'AmplifyPlugins/AWSAPIPlugin'
pod 'AWSMobileClient', '~> 2.12.0' # Required dependency
pod 'AWSAuthUI', '~> 2.12.0' # Optional dependency required to use drop-in UI
pod 'AWSUserPoolsSignIn', '~> 2.12.0' # Optional dependency required to use drop-in UI
# pod 'AWSAppSync', ' ~> 2.9.0'
If you add AWSAppSync you get this error
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "AWSCore":
In snapshot (Podfile.lock):
AWSCore (= 2.12.3)
In Podfile:
AWSAppSync (~> 2.9.0) was resolved to 2.9.2, which depends on
AWSCore (~> 2.8.0)
AWSAuthUI (~> 2.12.0) was resolved to 2.12.3, which depends on
AWSCore (= 2.12.3)
Here is an example of an API schema using owner permissions with Cognito user pools auth.
type Profile @model
@auth (
rules: [
{ allow: owner },
{ allow: private, operations: [create, read, update] }
]
)
{
id: ID!
email: String!
firstname: String
lastname: String
}
Notice there is no owner field in the API. Some documentation says to add it into the schema, some says the framework handles it for you.
Describe the solution you’d like
What is the correct way to access the API endpoint? Amplify.API or AWSAppSyncClient? Do we need to add an owner field and how does Amplify.API populate it and use it during retrieval?
Describe alternatives you’ve considered Changing the app back to using AWSAppSyncClient but Amplify.API is easier to read.
Additional context Don’t know what the clear direction is here. Please help.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)

Top Related StackOverflow Question
@lingxiao @jamesingham Looks like maybe you wanted me, @jamesonwilliams!
This is still a true statement as of 20APR2020, but we will be making an announcement “soon”.
Hi @ashishverma1108 - we have recently updated our documentation. Here’s the new iOS SDK getting started guide. https://docs.amplify.aws/start/q/integration/ios and here’s the iOS Amplify Libraries (preview) getting started guide: https://docs.amplify.aws/lib/getting-started/setup/q/platform/ios