You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/[platform]/build-a-backend/data/aws-appsync-apollo-extensions/index.mdx
+25-12
Original file line number
Diff line number
Diff line change
@@ -23,27 +23,38 @@ export function getStaticProps(context) {
23
23
};
24
24
}
25
25
26
-
AWS AppSync Apollo Extensions provide a seamless way to connect to your AWS AppSync backend using Apollo client, an open-source GraphQL client. The included AWS AppSync authorizers make it simple to apply the correct authorization payloads to your GraphQL operations within the Apollo client. The library allows you to connect directly to your AWS AppSync backend, including AppSync backends managed through Amplify Data.
26
+
AWS AppSync Apollo Extensions provide a seamless way to connect to your AWS AppSync backend using Apollo client, an open-source GraphQL client.
27
27
<InlineFilterfilters={["swift"]}>
28
28
29
29
To learn more about Apollo, see https://www.apollographql.com/docs/ios/.
30
30
31
31
</InlineFilter>
32
32
33
-
34
33
<InlineFilterfilters={["android"]}>
35
34
36
35
To learn more about Apollo, see https://www.apollographql.com/docs/kotlin.
37
36
38
37
</InlineFilter>
39
38
39
+
## Features
40
+
41
+
AWS AppSync Apollo Extensions provide AWS AppSync authorizers to be used with the Apollo client to make it simple to apply the correct authorization payloads to your GraphQL operations.
42
+
43
+
<InlineFilterfilters={["android"]}>
44
+
Additionally, we publish an optional Amplify extension that allows Amplify to provide auth tokens and signing logic for the corresponding Authorizers.
45
+
</InlineFilter>
46
+
47
+
<InlineFilterfilters={["swift"]}>
48
+
Additionally, the included Amplify components allow Amplify to provide auth tokens and signing logic for the corresponding Authorizers.
49
+
</InlineFilter>
50
+
40
51
## Install the AWS AppSync Apollo Extensions library
41
52
42
53
<InlineFilterfilters={["android"]}>
43
54
44
55
<BlockSwitcher>
45
56
46
-
<Blockname=" Amplify Data">
57
+
<Blockname="With Amplify">
47
58
48
59
Add the `apollo-appsync-amplify` dependency to your app/build.gradle.kts file.
49
60
@@ -58,7 +69,7 @@ dependencies {
58
69
59
70
</Block>
60
71
61
-
<Blockname="AppSync">
72
+
<Blockname="Without Amplify">
62
73
63
74
Add the `apollo-appsync` dependency to your app/build.gradle.kts file.
64
75
@@ -93,7 +104,7 @@ Enter its GitHub URL (`https://github.com/aws-amplify/aws-appsync-apollo-extensi
93
104
94
105
<BlockSwitcher>
95
106
96
-
<Blockname=" Amplify Data">
107
+
<Blockname="With Amplify">
97
108
Before you begin, you will need an Amplify Data backend deploy. To get started, see [Set up Data](/[platform]/build-a-backend/data/set-up-data/).
98
109
99
110
Once you have deployed your backend and created the `amplify_outputs.json` file, you can use Amplify library to read and retrieve your configuration values with the following steps:
@@ -108,7 +119,7 @@ val apolloClient = ApolloClient.Builder()
108
119
109
120
### AppSync Authorizers
110
121
111
-
Depending on the authorization strategy defined on your schema, you can use the corresponding Authorizer. To read more about the strategies and their corresponding auth modes, see [Available authorization strategies](/[platform]/build-a-backend/data/customize-authz/#available-authorization-strategies).
122
+
The AWS AppSync Apollo Extensions library provides a number of Authorizer classes to match the various authorization strategies that may be in use in your schema. You should choose the appropriate Authorizer type for your authorization strategy. To read more about the strategies and their corresponding auth modes, see [Available authorization strategies](/[platform]/build-a-backend/data/customize-authz/#available-authorization-strategies).
112
123
113
124
Some common ones are
114
125
@@ -194,7 +205,9 @@ val authorizer = IamAuthorizer {
194
205
195
206
</Block>
196
207
197
-
<Blockname="AppSync">
208
+
<Blockname="Without Amplify">
209
+
210
+
You can create your Apollo client by using our provided AWS AppSync endpoint and authorizer classes.
198
211
199
212
```kotlin
200
213
val endpoint =AppSyncEndpoint("<your_appsync_endpoint>")
Depending on the authorization strategy defined on your schema, you can use the corresponding Authorizer. To read more about the strategies and their corresponding auth modes, see [Available authorization strategies](/[platform]/build-a-backend/data/customize-authz/#available-authorization-strategies).
379
+
The AWS AppSync Apollo Extensions library provides a number of Authorizer classes to match the various authorization strategies that may be in use in your schema. You should choose the appropriate Authorizer type for your authorization strategy. To read more about the strategies and their corresponding auth modes, see [Available authorization strategies](/[platform]/build-a-backend/data/customize-authz/#available-authorization-strategies).
367
380
368
381
Some common ones are
369
382
@@ -382,7 +395,7 @@ The schema is used by Apollo’s code generation tool to generate API code that
382
395
<InlineFilterfilters={["swift"]}>
383
396
1. Navigate to your API on the [AWS AppSync console](https://console.aws.amazon.com/appsync/home)
384
397
2. On the left side, select Schema
385
-
3.When viewing your schema, there should a “Export schema” drop down. Select this and download the `schema.json` file.
398
+
3.Select the "Export schema" dropdown and download the `schema.json` file.
386
399
4. Add this file to your project as directed by [Apollo Code Generation documentation](https://www.apollographql.com/docs/ios/code-generation/introduction).
387
400
388
401
You can alternatively download the introspection schema using the [`fetch-schema`](https://www.apollographql.com/docs/ios/code-generation/codegen-cli#fetch-schema) command with the `amplify-ios-cli` tool.
@@ -393,7 +406,7 @@ You can alternatively download the introspection schema using the [`fetch-schema
393
406
394
407
1. Navigate to your API on the [AWS AppSync console](https://console.aws.amazon.com/appsync/home)
395
408
2. On the left side, select Schema
396
-
3.When viewing your schema, there should a “Export schema” drop down. Select this and download the `schema.json` file.
409
+
3.Select the "Export schema" dropdown and download the `schema.json` file.
397
410
4. Add this file to your project as directed by [Apollo documentation](https://www.apollographql.com/docs/kotlin/advanced/plugin-recipes#specifying-the-schema-location)
398
411
399
412
</InlineFilter>
@@ -404,7 +417,7 @@ You can alternatively download the introspection schema using the [`fetch-schema
404
417
405
418
<BlockSwitcher>
406
419
407
-
<Blockname=" Amplify Data">
420
+
<Blockname="With Amplify">
408
421
### Amplify provided .graphql files
409
422
1. Within your Amplify Gen2 backend, run: `npx ampx generate graphql-client-code --format graphql-codegen --statement-target graphql --out graphql`
410
423
2. Copy the generated files (`mutations.graphql`, `queries.graphql`, `subscriptions.graphql`) to your `{app}/src/main/graphql` folder as shown in the [Apollo documentation](https://www.apollographql.com/docs/kotlin#getting-started)
@@ -417,7 +430,7 @@ You can alternatively download the introspection schema using the [`fetch-schema
417
430
418
431
</Block>
419
432
420
-
<Blockname="AppSync">
433
+
<Blockname="Without Amplify">
421
434
422
435
1. Navigate to the **Queries** tab in your API on the [AWS AppSync console](https://console.aws.amazon.com/appsync/home). Here, you can test queries, mutations, and subscriptions in the GraphQL playground.
423
436
2. Enter your GraphQL operation (query, mutation, or subscription) in the editor and click **Run** to execute it.
0 commit comments