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/content/docs/aws/services/appsync.md
+35-33Lines changed: 35 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,5 @@
1
1
---
2
2
title: "AppSync"
3
-
linkTitle: "AppSync"
4
3
description: Get started with AppSync on LocalStack
5
4
tags: ["Ultimate"]
6
5
---
@@ -11,7 +10,7 @@ AppSync is a managed service provided by Amazon Web Services (AWS) that enables
11
10
AppSync allows you to define your data models and business logic using a declarative approach, and connect to various data sources, including other AWS services, relational databases, and custom data sources.
12
11
13
12
LocalStack allows you to use the AppSync APIs in your local environment to connect your applications and services to data and events.
14
-
The supported APIs are available on our [API coverage page]({{< ref "coverage_appsync" >}}), which provides information on the extent of AppSync's integration with LocalStack.
13
+
The supported APIs are available on our [API coverage page](), which provides information on the extent of AppSync's integration with LocalStack.
15
14
16
15
## Getting started
17
16
@@ -25,20 +24,20 @@ We will demonstrate how to create an AppSync API with a DynamoDB data source usi
25
24
You can create a DynamoDB table using the [`CreateTable`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html) API.
26
25
Execute the following command to create a table named `DynamoDBNotesTable` with a primary key named `NoteId`:
After the table is created, you can use the [`ListTables`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ListTables.html) API.
37
36
Run the following command to list all tables in your running LocalStack container:
38
37
39
-
{{< command >}}
40
-
$ awslocal dynamodb list-tables
41
-
{{< /command >}}
38
+
```bash
39
+
awslocal dynamodb list-tables
40
+
```
42
41
43
42
The following output would be retrieved:
44
43
@@ -55,11 +54,11 @@ The following output would be retrieved:
55
54
You can create a GraphQL API using the [`CreateGraphqlApi`](https://docs.aws.amazon.com/appsync/latest/APIReference/API_CreateGraphqlApi.html) API.
56
55
Execute the following command to create a GraphQL API named `NotesApi`:
57
56
58
-
{{< command >}}
59
-
$ awslocal appsync create-graphql-api \
57
+
```bash
58
+
awslocal appsync create-graphql-api \
60
59
--name NotesApi \
61
60
--authentication-type API_KEY
62
-
{{< /command >}}
61
+
```
63
62
64
63
The following output would be retrieved:
65
64
@@ -83,10 +82,10 @@ The following output would be retrieved:
83
82
You can now create an API key for your GraphQL API using the [`CreateApiKey`](https://docs.aws.amazon.com/appsync/latest/APIReference/API_CreateApiKey.html) API.
84
83
Execute the following command to create an API key for your GraphQL API:
85
84
86
-
{{< command >}}
87
-
$ awslocal appsync create-api-key \
85
+
```bash
86
+
awslocal appsync create-api-key \
88
87
--api-id 014d18d0c2b149ee8b66f39173
89
-
{{< /command >}}
88
+
```
90
89
91
90
The following output would be retrieved:
92
91
@@ -130,11 +129,11 @@ type Schema {
130
129
Youcanstarttheschema creation process using the [`StartSchemaCreation`](https://docs.aws.amazon.com/appsync/latest/APIReference/API_StartSchemaCreation.html) API.
131
130
Execute the following command to start the schema creation process:
132
131
133
-
{{< command >}}
134
-
$ awslocalappsyncstart-schema-creation \
132
+
```bash
133
+
awslocal appsync start-schema-creation \
135
134
--api-id 014d18d0c2b149ee8b66f39173 \
136
135
--definition file://schema.graphql
137
-
{{< /command >}}
136
+
```
138
137
139
138
The following output would be retrieved:
140
139
@@ -149,13 +148,13 @@ The following output would be retrieved:
149
148
You can create a data source using the [`CreateDataSource`](https://docs.aws.amazon.com/appsync/latest/APIReference/API_CreateDataSource.html) API.
150
149
Execute the following command to create a data source named `DynamoDBNotesTable`:
@@ -179,27 +178,27 @@ You can create a resolver using the [`CreateResolver`](https://github.com/locals
179
178
You can create a custom `request-mapping-template.vtl` and `response-mapping-template.vtl` file to use as a mapping template to use for requests and responses respectively.
180
179
Execute the following command to create a VTL resolver attached to the `PaginatedNotes.notes` field:
--code 'export function request(ctx) { return ctx.result; }; export function response(ctx) {};' \
283
282
--context '{"result": "ok"}'
284
-
<disable-copy>
283
+
```
284
+
285
+
The following output would be retrieved:
286
+
287
+
```bash
285
288
{
286
289
"evaluationResult": "ok",
287
290
"logs": []
288
291
}
289
-
</disable-copy>
290
-
{{< / command >}}
292
+
```
291
293
292
294
## Resource Browser
293
295
294
296
The LocalStack Web Application provides a Resource Browser for managing AppSync APIs, Data Sources, Schema, Query, Types, Resolvers, Functions and API keys.
295
297
You can access the Resource Browser by opening the LocalStack Web Application in your browser, navigating to the **Resources** section, and then clicking on **AppSync** under the **App Integration** section.
0 commit comments