Skip to content

Commit

Permalink
docs: improve getting started experience
Browse files Browse the repository at this point in the history
GITHUB_PR_NUMBER: 6143
GITHUB_PR_URL: hasura#6143

Co-authored-by: Marion Schleifer <5722022+marionschleifer@users.noreply.github.com>
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 7ad41cb
  • Loading branch information
3 people committed Feb 18, 2021
1 parent 4c75995 commit 9b9bcf5
Show file tree
Hide file tree
Showing 14 changed files with 164 additions and 167 deletions.
89 changes: 78 additions & 11 deletions docs/graphql/cloud/getting-started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,32 +76,99 @@ Click ``Create Project``.
:group: create
:class: inline-block

Step 4: Try Hasura out
Step 4: Try out Hasura
----------------------

Click ``Launch Console`` to open the Hasura console in your browser and
:ref:`make your first GraphQL query <first_graphql_query>` or :ref:`set up your first event trigger <first_event_trigger>`.
Click ``Launch Console`` to open the Hasura console in your browser:

.. thumbnail:: /img/graphql/cloud/getting-started/project-launch-console.png
:alt: Project actions
:width: 860px

You can navigate to the ``Pro`` tab in the console to check out the Pro features that Hasura Cloud has set up for you.
Create a table
^^^^^^^^^^^^^^

.. thumbnail:: /img/graphql/cloud/metrics/pro-tab-overview.png
:alt: Hasura Console: Pro tab
:width: 1000px
On the Hasura console, navigate to ``Data -> Create table`` and create a sample table called ``profiles`` with
the following columns:

.. code-block:: sql
profiles (
id SERIAL PRIMARY KEY, -- serial -> auto-incrementing integer
name TEXT
)
.. thumbnail:: /img/graphql/core/getting-started/create-profile-table.png
:alt: Create a table

Now, insert some sample data into the table using the ``Insert Row`` tab of the ``profiles`` table.

Try out a query
^^^^^^^^^^^^^^^

Head to the ``GraphiQL`` tab in the console and try running the following query:

.. code-block:: graphql
query {
profiles {
id
name
}
}
You'll see that you get all the inserted data!

.. thumbnail:: /img/graphql/core/getting-started/profile-query.png
:alt: Try out a query


Check out monitoring
^^^^^^^^^^^^^^^^^^^^

You can navigate to the ``Monitoring`` tab in the console to check out the Pro features that Hasura Cloud has set up for you.

.. thumbnail:: /img/graphql/cloud/metrics/monitoring-tab-overview.png
:alt: Hasura Console: Monitoring tab

Next steps
----------

You can check out our `30-Minute Hasura Basics Course <https://hasura.io/learn/graphql/hasura/introduction/>`__
and other `GraphQL & Hasura Courses <https://hasura.io/learn/>`__ for a more detailed introduction to Hasura.
Learn course
^^^^^^^^^^^^

For a full hands-on tour of Hasura, check out our `30-Minute Hasura Basics Course <https://hasura.io/learn/graphql/hasura/introduction/>`__.

Database operations
^^^^^^^^^^^^^^^^^^^

- :ref:`Database modelling <schema>`: Learn how to model your database schema, as well as how to extend it.
- :ref:`Querying data <queries>`: Use GraphQL queries to query data from your GraphQL API.
- :ref:`Inserting data <mutations>`: Use GraphQL mutations to insert data into your GraphQL API.

Business logic
^^^^^^^^^^^^^^

You can also click the gear icon to manage your Hasura Cloud project. (e.g. add :ref:`collaborators <manage_project_collaborators>`,
:ref:`env vars <manage_project_env_vars>` or :ref:`custom domains <manage_project_domains>`) and :ref:`add an admin secret <secure_project>`
There are several options for the implementation of business logic, depending on your use case.

- :ref:`Actions <actions>`: Actions can be used if you'd like to extend your GraphQL schema by integrating with a REST endpoint.
- :ref:`Remote schemas <remote_schemas>`: If you have an existing GraphQL server or if you're comfortable with implementing one, you can use remote schemas.
- :ref:`Event triggers <event_triggers>`: To trigger a serverless function based on a database event, use event triggers.
- :ref:`Scheduled triggers <scheduled_triggers>`: Scheduled triggers are used to execute custom business logic at specific points in time.

Secure your endpoint
^^^^^^^^^^^^^^^^^^^^

:ref:`Add an admin secret <secure_project>`
to make sure that your GraphQL endpoint and the Hasura console are not publicly accessible.


Manage Hasura Cloud project
^^^^^^^^^^^^^^^^^^^^^^^^^^^

You can click the gear icon in the Hasura Cloud dashboard to manage your Hasura Cloud project (e.g. add :ref:`collaborators <manage_project_collaborators>`,
:ref:`env vars <manage_project_env_vars>` or :ref:`custom domains <manage_project_domains>`).

.. thumbnail:: /img/graphql/cloud/getting-started/project-manage.png
:alt: Project actions
:width: 860px
Expand Down
2 changes: 1 addition & 1 deletion docs/graphql/cloud/metrics/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Introduction

Hasura Cloud projects include Pro features for enhanced reliability and performance

.. thumbnail:: /img/graphql/cloud/metrics/pro-tab-overview.png
.. thumbnail:: /img/graphql/cloud/metrics/monitoring-tab-overview.png
:alt: Hasura Cloud Console overview tab

Learn more
Expand Down
2 changes: 1 addition & 1 deletion docs/graphql/cloud/metrics/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ Overview

The Overview displays aggregate stats over the last hour:

.. thumbnail:: /img/graphql/cloud/metrics/pro-tab-overview.png
.. thumbnail:: /img/graphql/cloud/metrics/monitoring-tab-overview.png
:alt: Hasura Cloud Console overview tab
6 changes: 3 additions & 3 deletions docs/graphql/cloud/projects/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ For each project, you can do the one of the following actions:
:alt: Project actions
:width: 860px

- Click ``Launch Console`` to open the Hasura console in your browser. The ``Pro`` tab
- Click ``Launch Console`` to open the Hasura console in your browser. The ``Monitoring`` tab
lets you use the Pro features that Hasura Cloud has set up for you.

.. thumbnail:: /img/graphql/cloud/metrics/pro-tab-overview.png
:alt: Hasura Console: Pro tab
.. thumbnail:: /img/graphql/cloud/metrics/monitoring-tab-overview.png
:alt: Hasura Console: Monitoring tab
:width: 900px

- Click the gear icon to manage your project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,8 @@ Replace ``<dns-name-label>`` with the label given earlier.
.. image:: https://storage.googleapis.com/graphql-engine-cdn.hasura.io/main-repo/img/azure_arm_aci_console_graphiql.png
:class: no-shadow
:alt: Hasura console

You can create tables and test your GraphQL queries here. Check out :ref:`Making
your first GraphQL Query <first_graphql_query>` for a detailed guide.

You can create tables and test your GraphQL queries here.

Troubleshooting
---------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ to open the Hasura console.
To test it, you can either create tables directly using the console, or add new users to your project clicking on ``Auth`` on the navigation menu.

There is also a ``GraphQL API`` option for you to test the API.
Check out :ref:`making your first GraphQL query <first_graphql_query>` for more information.

References
----------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ You can monitor the deployment of the Hasura web service from the **Logs** tab.
You can create tables and test your GraphQL queries here.

Check out :ref:`making your first GraphQL query <first_graphql_query>` or :ref:`setting up your first event trigger <first_event_trigger>` for more.

References
----------

Expand Down
87 changes: 79 additions & 8 deletions docs/graphql/core/getting-started/docker-simple.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ to deploy the Hasura GraphQL engine as a standalone docker container and connect
Prerequisites
-------------

- `Docker <https://docs.docker.com/install/>`_
- `Docker Compose <https://docs.docker.com/compose/install/>`_
- `Docker <https://docs.docker.com/install/>`__
- `Docker Compose <https://docs.docker.com/compose/install/>`__

Step 1: Get the docker-compose file
-----------------------------------
Expand Down Expand Up @@ -63,17 +63,88 @@ Step 3: Open the Hasura console

Head to ``http://localhost:8080/console`` to open the Hasura console.

Step 4: Try Hasura out
Step 4: Try out Hasura
----------------------

Make your :ref:`first graphql query <first_graphql_query>` or set up your :ref:`first event trigger <first_event_trigger>`
Create a table
^^^^^^^^^^^^^^

You can also check out our `30-Minute Hasura Basics Course <https://hasura.io/learn/graphql/hasura/introduction/>`__
and other `GraphQL & Hasura Courses <https://hasura.io/learn/>`__ for a more detailed introduction to Hasura.
On the Hasura console, navigate to ``Data -> Create table`` and create a sample table called ``profiles`` with
the following columns:

Advanced
--------
.. code-block:: sql
profiles (
id SERIAL PRIMARY KEY, -- serial -> auto-incrementing integer
name TEXT
)
.. thumbnail:: /img/graphql/core/getting-started/create-profile-table.png
:alt: Create a table

Now, insert some sample data into the table using the ``Insert Row`` tab of the ``profiles`` table.

Try out a query
^^^^^^^^^^^^^^^

Head to the ``GraphiQL`` tab in the console and try running the following query:

.. code-block:: graphql
query {
profiles {
id
name
}
}
You'll see that you get all the inserted data!

.. thumbnail:: /img/graphql/core/getting-started/profile-query.png
:alt: Try out a query

Next steps
----------

Learn course
^^^^^^^^^^^^

For a full hands-on tour of Hasura, check out our `30-Minute Hasura Basics Course <https://hasura.io/learn/graphql/hasura/introduction/>`__.

Database operations
^^^^^^^^^^^^^^^^^^^

- :ref:`Database modelling <schema>`: Learn how to model your database schema, as well as how to extend it.
- :ref:`Querying data <queries>`: Use GraphQL queries to query data from your GraphQL API.
- :ref:`Inserting data <mutations>`: Use GraphQL mutations to insert data into your GraphQL API.

Business logic
^^^^^^^^^^^^^^

There are several options for the implementation of business logic, depending on your use case.

- :ref:`Actions <actions>`: Actions can be used if you'd like to extend your GraphQL schema by integrating with a REST endpoint.
- :ref:`Remote schemas <remote_schemas>`: If you have an existing GraphQL server or if you're comfortable with implementing one, you can use remote schemas.
- :ref:`Event triggers <event_triggers>`: To trigger a serverless function based on a database event, use event triggers.
- :ref:`Scheduled triggers <scheduled_triggers>`: Scheduled triggers are used to execute custom business logic at specific points in time.

Migrations
^^^^^^^^^^

Set up :ref:`Hasura migrations <migrations_setup>` to track your database alterations. This will make it easier to move to a different environment (e.g. staging or prod) later.

Secure your endpoint
^^^^^^^^^^^^^^^^^^^^

:ref:`Add an admin secret <secure_project>`
to make sure that your GraphQL endpoint and the Hasura console are not publicly accessible.

Advanced Docker setup
---------------------

This was a quickstart guide to get the Hasura GraphQL engine up and running
quickly. For more detailed instructions on deploying using Docker with an
external database, check out :ref:`deployment_docker`.

- :ref:`Using Docker <deployment_docker>`: Run as a docker container and connect to an existing Postgres
database.
71 changes: 0 additions & 71 deletions docs/graphql/core/getting-started/first-event-trigger.rst

This file was deleted.

Loading

0 comments on commit 9b9bcf5

Please sign in to comment.