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/fragments/start/getting-started/angular/setup.mdx
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,9 @@ import 'core-js/es/object';
31
31
32
32
## Create a new Amplify backend
33
33
34
-
Now that we have a running Angular app, it's time to set up Amplify for this app so that we can create the necessary backend services needed to support the app. From the root of the project, run:
34
+
Now that we have a running Angular app, it's time to set up Amplify for this app so that we can create the necessary backend services needed to support the app.
35
+
36
+
Open a new terminal. From the root of the project, run:
@@ -61,26 +59,26 @@ Once you're signed in, Amplify CLI will ask you to create an IAM user.
61
59
62
60
```console
63
61
Specify the AWS Region
64
-
? region: # Your preferred region
62
+
? region: <Your preferred region>
65
63
Specify the username of the new IAM user:
66
-
? user name: # User name for Amplify IAM user
67
-
Complete the user creation using the AWS console
64
+
? user name: <User name for Amplify IAM user>
65
+
Complete the user creation using the AWS console: <URL>
68
66
```
69
67
70
-
Create a user with `AdministratorAccess-Amplify` to your account to provision AWS resources for you like AppSync, Cognito etc.
68
+
Follow the `<URL>` and create a user with `AdministratorAccess-Amplify` to your account to provision AWS resources for you like AppSync, Cognito etc.
71
69
72
70

73
71
74
-
Once the user is created, Amplify CLI will ask you to provide the `accessKeyId` and the `secretAccessKey`to connect Amplify CLI with your newly created IAM user.
72
+
Amplify CLI will then ask you to copy and paste the `accessKeyId` and the `secretAccessKey`from your newly created IAM user to connect with Amplify CLI.
75
73
76
74
```console
77
75
Enter the access key of the newly created user:
78
-
? accessKeyId: # YOUR_ACCESS_KEY_ID
79
-
? secretAccessKey: # YOUR_SECRET_ACCESS_KEY
76
+
? accessKeyId: <ACCESSKEYID>
77
+
? secretAccessKey: <ACCESSKEY>
80
78
This would update/create the AWS Profile in your local machine
81
-
? Profile Name: # (default)
79
+
? Profile Name: default
80
+
```
82
81
83
82
Successfully set up the new user.
84
-
```
85
83
86
-
Next, we'll set up the app and initialize Amplify!
84
+
In the next section, you'll set up the app and initialize Amplify.
Copy file name to clipboardExpand all lines: src/fragments/start/getting-started/ionic/setup.mdx
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,9 @@ This runs a development server and allows us to see the output generated by the
13
13
14
14
## Initialize a new backend
15
15
16
-
Now that we have a running Ionic app, it's time to set up Amplify so that we can create the necessary backend services needed to support the app. From the root of the project, run:
16
+
Now that we have a running Ionic app, it's time to set up Amplify so that we can create the necessary backend services needed to support the app.
17
+
18
+
Open a new terminal. From the root of the project, run:
Copy file name to clipboardExpand all lines: src/fragments/start/getting-started/react/api.mdx
+21-24Lines changed: 21 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,24 +15,9 @@ amplify add api
15
15
Accept the **default values** which are highlighted below:
16
16
17
17
```console
18
-
? Please select from one of the below mentioned services:
19
-
# GraphQL
20
-
? Provide API name:
21
-
# myapi
22
-
? Choose the default authorization type for the API:
23
-
# API Key
24
-
? Enter a description for the API key:
25
-
# demo
26
-
? After how many days from now the API key should expire:
27
-
# 7 (or your preferred expiration)
28
-
? Do you want to configure advanced settings for the GraphQL API:
29
-
# No
30
-
? Do you have an annotated GraphQL schema?
31
-
# No
32
-
? Choose a schema template:
33
-
# Single object with fields (e.g., “Todo” with ID, name, description)
34
-
? Do you want to edit the schema now?
35
-
# Yes
18
+
? Select from one of the below mentioned services: GraphQL
19
+
? Here is the GraphQL API that we will create. Select a setting to edit or continue Continue
20
+
? Choose a schema template: Single object with fields (e.g., “Todo” with ID, name, description)
36
21
```
37
22
38
23
The CLI should open this GraphQL schema in your text editor.
@@ -74,6 +59,18 @@ amplify push
74
59
? Enter maximum statement depth [increase from default if your schema is deeply nested]: 2
75
60
```
76
61
62
+
```console
63
+
? Are you sure you want to continue? Yes
64
+
65
+
...
66
+
67
+
? Do you want to generate code for your newly created GraphQL API Yes
68
+
? Choose the code generation language target javascript
69
+
? Enter the file name pattern of graphql queries, mutations and subscriptions src/graphql/**/*.js
70
+
? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions Yes
71
+
? Enter maximum statement depth [increase from default if your schema is deeply nested] 2
72
+
```
73
+
77
74
Now the API is live and you can start interacting with it!
78
75
79
76
The API you have deployed is for a Todo app, including operations for creating, reading, updating, deleting, and listing todos.
@@ -116,13 +113,13 @@ To test this out locally, you can run the `mock` command.
116
113
amplify mock api
117
114
```
118
115
119
-
*Note:* `amplify mock api` requires Java.
116
+
*Note:* `amplify mock api` requires Java. If you have not already deployed your API with `amplify push`, you will be walked through the following steps for GraphQL code generation.
120
117
121
118
```console
122
-
# If you have not already deployed you API, you will be walked through the following steps for GraphQL code generation
123
-
? Choose the code generation language target: javascript (or preferred target)
124
-
? Enter the file name pattern of graphql queries, mutations and subscriptions: src/graphql/**/*.js
125
-
? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions: Yes
119
+
? Do you want to generate code for your newly created GraphQL API Yes
120
+
? Choose the code generation language target javascript
121
+
? Enter the file name pattern of graphql queries, mutations and subscriptions src/graphql/**/*.js
122
+
? Do you want to generate/update all possible GraphQL operations - queries, mutations and subscriptions Yes
126
123
? Enter maximum statement depth [increase from default if your schema is deeply nested] 2
127
124
```
128
125
@@ -245,7 +242,7 @@ export default App
245
242
246
243
Let's walk through some of the functions:
247
244
248
-
__useEffect__ - When the component loads, the `useEffect` hook is called and it invokes the `fetchTodos` function.
245
+
__useEffect__ - After the component renders, the `useEffect` hook is called and it invokes the `fetchTodos` function.
249
246
250
247
__fetchTodos__ - Uses the Amplify `API` category to call the AppSync GraphQL API with the `listTodos` query. Once the data is returned, the items array is passed in to the `setTodos` function to update the local state.
0 commit comments