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
# This "input" configures a global authorization rule to enable public access to
34
+
# all models in this schema. Learn more about authorization rules here: https://docs.amplify.aws/cli/graphql/authorization-rules
35
+
inputAMPLIFY { globalAuthRule: AuthRule = { allow: public } } # FOR TESTING ONLY!
36
+
43
37
typeTodo@model {
44
38
id: ID!
45
39
name: String!
46
40
description: String
47
41
}
42
+
48
43
```
49
44
50
-
Theschema generated is for a Todo app. You'll notice a directive on the `Todo` type of `@model`. This directive is part of the [GraphQL transform](/cli/graphql/data-modeling) library of Amplify.
45
+
Theschema generated is for a Todo app. You'll notice a `@model` directive on the `Todo` type. This directive is part of the [GraphQL transformer](/cli/graphql/data-modeling) feature of the Amplify CLI.
51
46
52
-
The GraphQL Transform Library provides custom directives you can use in your schema that allow you to do things like define data models, set up authentication and authorization rules, configure serverless functions as resolvers, and more.
47
+
The GraphQL transformer provides custom GraphQL directives that allow you to define data models, set up authorization rules, configure serverless functions as resolvers, and more.
53
48
54
-
A type decorated with the `@model` directive will scaffold out the database table for the type (Todo table), the schema for CRUD (create, read, update, delete) and list operations, and the GraphQL resolvers needed to make everything work together.
49
+
A GraphQL type decorated with the `@model` directive will scaffold out the database table for the type (Todo table), the schema for CRUD (create, read, update, delete) and list operations, and the GraphQL resolvers needed to make everything work together.
55
50
56
51
From the command line, press __enter__ to accept the schema and continue to the next steps.
57
52
58
53
## Deploy your GraphQL API
59
54
60
-
Now that the API has been successfully created. We need to push our updated configuration to the cloud so our API can be deployed:
55
+
Now that the API has been successfully created locally, you need to deploy the API to the cloud:
61
56
62
57
```bash
63
58
amplify push
64
59
```
65
60
66
61
## Generate code for the GraphQL API
67
62
68
-
When you run `amplify push`, you will be presented with the option to have all the GraphQL operations found in your schema generated for you in code. Choose the following options:
63
+
When you run `amplify push`, you can generate client code for all the GraphQL operations (create, read, update, delete, list). These client code snippets allow you to execute these GraphQL operations more easily with the help of the Amplify JavaScript library. Choose the following options:
69
64
70
65
```console
71
66
? Do you want to generate code for your newly created GraphQL API (Yes)
@@ -226,4 +221,4 @@ Now if you wish to subscribe to data, import the `onCreateTodo` subscription and
226
221
getData();
227
222
```
228
223
229
-
After restarting your app using `npm start` go back to your browser and using dev tools you will see data being stored and retrieved in your backend from the console logs.
224
+
After restarting your app using `npm start` go back to your browser and you will see subscription events displayed under **Subscription Results**.
Copy file name to clipboardExpand all lines: src/fragments/start/getting-started/vanillajs/hosting.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
You've successfully built your first app with Amplify! Now that you've built something, it's time to deploy it to the web with Amplify Console!
1
+
You've successfully built your first app with Amplify! Now that you've built something, it's time to deploy it to the web with Amplify Hosting!
2
2
3
3
## Add hosting to your app
4
4
You can manually deploy your web app or setup automatic continuous deployment. In this guide we'll cover how to manually deploy and host your static web app to quickly share with others. If you want to learn about continuous deployment instead, please follow [this guide](https://docs.aws.amazon.com/amplify/latest/userguide/multi-environments.html#standard).
@@ -23,12 +23,12 @@ amplify publish
23
23
24
24
👏 Congratulations, your app is online!
25
25
26
-

26
+

27
27
28
28
After publishing, your terminal will display your app URL hosted on a `amplifyapp.com` domain. Whenever you have additional changes to publish, just re-run the `amplify publish` command.
29
29
30
-
You may get an "AccessDenied" error if your app's distribution directory is not set properly. To fix this, change the distribution directory via `amplify configure project` and then re-run `amplify publish`.
30
+
> You may get an "AccessDenied" error if your app's distribution directory is not set properly. To fix this, change the distribution directory via `amplify configure project` and then re-run `amplify publish`.
31
31
32
32
To view your app and hosting configuration in the Amplify Console, run the `amplify console` command.
33
33
34
-
Note: In order to delete all the environments of the project from the cloud and wipe out all the local files created by Amplify CLI, run `amplify delete` command. Now, to observe that your Amplify project resources have been deleted, run `amplify status` command.
34
+
Note: To delete all the environments of the project from the cloud and wipe out all the local files created by Amplify CLI, run `amplify delete` command.
0 commit comments