![]() * move to Sources and Tests for API * update Package.swift * Add APIHostApp, rename to drop Category naming * APIHostApp compiling with AmplifyTestCommon files * APIFunctional tets working * add additional schemas * Remove AWSPluginCore dependency * revert unintended changes * remove unintended changes * remove unintented changes * fix unintended changes * fix unintended changes |
||
---|---|---|
.. | ||
GraphQLSyncBasedTests.swift | ||
GraphQLSyncCustomPrimaryKeyTests.swift | ||
README.md |
README.md
Sync Based GraphQL
The following steps demonstrate how to set up an GraphQL endpoint with AppSync that is provisioned with conflict resolution (Sync-based API). The auth configured will be API key. The set up is used to run the tests in GraphQLSyncBasedTests.swift
.
Set-up
-
amplify init
-
amplify add api
? Please select from one of the below mentioned services: `GraphQL`
? Provide API name: `<APIName>`
? Choose the default authorization type for the API `API key`
? Enter a description for the API key:
? After how many days from now the API key should expire (1-365): `365`
? Do you want to configure advanced settings for the GraphQL API `Yes, I want to make some additional changes.`
? Configure additional auth types? `No`
? Configure conflict detection? `Yes`
? Select the default resolution strategy `Optimistic Concurrency`
? Do you want to override default per model settings? `No`
? Do you have an annotated GraphQL schema? `Yes`
? Provide your schema file path: `schema.graphql`
When asked to provide the schema, create the schema.graphql
file
enum PostStatus {
PRIVATE
DRAFT
PUBLISHED
}
type Post @model {
id: ID!
title: String!
content: String!
createdAt: AWSDateTime!
updatedAt: AWSDateTime
draft: Boolean
rating: Float
status: PostStatus
comments: [Comment] @connection(name: "PostComment")
}
type Comment @model {
id: ID!
content: String!
createdAt: AWSDateTime!
post: Post @connection(name: "PostComment")
}
type CustomerOrder @model
@key(fields: ["orderId","id"]) {
id: ID!
orderId: String!
email: String!
}
-
amplify push
-
Copy
amplifyconfiguration.json
over asGraphQLSyncBasedTests-amplifyconfiguration.json
to~/.aws-amplify/amplify-ios/testconfiguration/