docs: move cloud docs (#5411)
@ -1,5 +1,7 @@
|
||||
.. title:: 404 - Page Not Found
|
||||
|
||||
:orphan:
|
||||
|
||||
404 - Page Not Found
|
||||
---------------------
|
||||
|
||||
|
6
docs/_static/styles/landing.css
vendored
@ -15,13 +15,11 @@
|
||||
}
|
||||
|
||||
.body_content {
|
||||
font-family: 'Gudea';
|
||||
font-size: 15px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.small_content {
|
||||
font-family: 'Gudea';
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
}
|
||||
@ -101,6 +99,10 @@
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.description {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.text_left {
|
||||
text-align: left;
|
||||
}
|
||||
|
4
docs/_static/styles/main.css
vendored
@ -640,6 +640,10 @@ article ol ol {
|
||||
margin: 15px;
|
||||
}
|
||||
|
||||
.sphinxsidebarwrapper > ul:not(.current) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#sidebar {
|
||||
background-color: #001934;
|
||||
width: 24% !important;
|
||||
|
10
docs/_theme/djangodocs/layout.html
vendored
@ -4,6 +4,12 @@
|
||||
{% set is_landing_page = true %}
|
||||
{%- endif %}
|
||||
|
||||
{%- if 'graphql/manual' in pagename %}
|
||||
{% set is_core = true %}
|
||||
{%- elif 'cloud' in pagename %}
|
||||
{% set is_cloud = true %}
|
||||
{%- endif %}
|
||||
|
||||
{% set css_files = css_files + ['_static/graphiql/graphiql.css', '_static/styles/main.css'] %}
|
||||
|
||||
{%- if is_landing_page %}
|
||||
@ -187,12 +193,12 @@
|
||||
<img src="{{ pathto('_images/layout/close-icon.svg', 1) }}" alt="Close"/>
|
||||
</div>
|
||||
<div class="tabbarContainerWrapper blueBgColor boderBottom">
|
||||
<a href="" class="tabbarTabActive">
|
||||
<a href="{{ pathto('graphql/manual/index.html', 1) }}" {%- if is_core %} class="tabbarTabActive" {%- endif %}>
|
||||
<span>
|
||||
Hasura Core
|
||||
</span>
|
||||
</a>
|
||||
<a href="https://hasura.io/docs/cloud/1.0/manual/index.html">
|
||||
<a href="{{ pathto('cloud/index.html', 1) }}" {%- if is_cloud %} class="tabbarTabActive" {%- endif %}>
|
||||
<span>
|
||||
Hasura Cloud
|
||||
</span>
|
||||
|
21
docs/_theme/djangodocs/localtoc.html
vendored
@ -1,24 +1,3 @@
|
||||
{%- if display_toc %}
|
||||
<!--
|
||||
<div class="header_main_logo inline-block mobile-hide">
|
||||
<a href="https://{{ BASE_DOMAIN }}/" target="_blank" rel="noopener">
|
||||
<div class="img_wrapper inline-block">
|
||||
<img class="responsive logo_img" src="{{ pathto('_images/layout/logo-lite.svg', 1) }}" alt="Hasura Logo Light" />
|
||||
</div>
|
||||
</a>
|
||||
<a class="docs_label" href="{{ pathto('', 1) }}">
|
||||
<div class="inline-block hero"> docs </div>
|
||||
</a>
|
||||
<a class="version_txt">
|
||||
<select value="{{ version }}" onchange="location = this.value;" class="selected" aria-label="Select Version">
|
||||
{%- if version == '1.0' %}
|
||||
<option class="option_val" value="https://{{ BASE_DOMAIN }}/docs/1.0/graphql/manual/index.html" selected="selected">v1.x</option>
|
||||
{%- else -%}
|
||||
<option class="option_val" value="https://{{ BASE_DOMAIN }}/docs/1.0/graphql/manual/index.html">v1.x</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</a>
|
||||
</div>
|
||||
-->
|
||||
{{ toc_full }}
|
||||
{%- endif %}
|
||||
|
32
docs/_theme/djangodocs/pages/landing.html
vendored
@ -5,25 +5,23 @@
|
||||
<div class="box_head_wrapper">
|
||||
<div class="box_head">
|
||||
<img src="{{ pathto('_images/landing/graphql.svg', 1) }}" alt="GraphQL engine"/>
|
||||
<h3 class="head_wrapper">1. The Hasura GraphQL engine</h3>
|
||||
</div>
|
||||
<div class="view_all_wrapper small_content">
|
||||
<h3 class="head_wrapper">Hasura docs</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="small_content space_wrapper text_left">
|
||||
This guide covers all Hasura GraphQL engine concepts and features.
|
||||
<br/> <br/>
|
||||
</div>
|
||||
<div class="sign_in_wrapper space_wrapper">
|
||||
<div class="get_start">
|
||||
<img src="{{ pathto('_images/landing/manual.svg', 1) }}" alt="Manual"/>
|
||||
</div>
|
||||
<a href="{{ pathto('graphql/manual/index.html', 1) }}">
|
||||
<div class="docs_link body_content">
|
||||
Open manual
|
||||
<img src="{{ pathto('_images/landing/right-arrow.svg', 1) }}" alt="Right Arrow" />
|
||||
</div>
|
||||
</a>
|
||||
<div class="space_wrapper text_left">
|
||||
<p class="description">This guide covers all Hasura concepts and features.</p>
|
||||
<ul>
|
||||
<li>
|
||||
<a class="docs_link" href="{{ pathto('graphql/manual/index.html', 1) }}">
|
||||
Core docs
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="docs_link" href="{{ pathto('cloud/index.html', 1) }}">
|
||||
Cloud docs
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
34
docs/cloud/allow-lists.rst
Normal file
@ -0,0 +1,34 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud allow lists
|
||||
:keywords: hasura, docs, cloud, security, allow
|
||||
|
||||
.. _allow_lists:
|
||||
|
||||
Allow lists
|
||||
===========
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
You can specify a list of safe operations (GraphQL queries, mutations or subscriptions) for your project. This list restricts your project's GraphQL Engine to execute only queries that are present in the list.
|
||||
|
||||
Manage the allow list
|
||||
---------------------
|
||||
|
||||
The manager view offers inspection, export, or removal of operations in the allow list:
|
||||
|
||||
.. thumbnail:: /img/cloud/security/pro-tabs-allowlist.png
|
||||
:alt: Hasura Cloud Console allow list tab
|
||||
|
||||
Quick-create allowed operations
|
||||
-------------------------------
|
||||
|
||||
This Pro feature lets you add to the allow list with one click from the record of past operations. (With Core, allow lists must be :ref:`managed manually <allow_list>`.)
|
||||
|
||||
.. thumbnail:: /img/cloud/security/allowlist-add-new-op.png
|
||||
:alt: Hasura Cloud Console create new allowed operation
|
49
docs/cloud/api-limits.rst
Normal file
@ -0,0 +1,49 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud API limits
|
||||
:keywords: hasura, docs, cloud, security, limits
|
||||
|
||||
.. _api_limits:
|
||||
|
||||
API limits
|
||||
==========
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Limiting the depth and/or rate of API requests can help prevent API performance issues caused by malicious or poorly implemented queries.
|
||||
|
||||
Configuring an API limit
|
||||
------------------------
|
||||
|
||||
**Rate limits**
|
||||
Restricts number of GraphQL operations per minute. This uses a sliding window approach. This means whenever Hasura Pro receives a request, it will count the rate of that client starting from the current time to last one minute.
|
||||
|
||||
**Depth limits**
|
||||
Restricts a GraphQL operation based on its depth, preventing deeply nested queries.
|
||||
|
||||
API limits are defined by **role** (anonymous, user) and can restrict request rate, depth, or both. Unique request parameters can include IP address or session variables (*x-hasura-user-id*, *x-hasura-org-id*, etc.)
|
||||
|
||||
Manage API limits
|
||||
-----------------
|
||||
|
||||
API limits can have a *global* or *per role* configuration. If an incoming request does not contain a valid role then the global limit is applied.
|
||||
|
||||
.. thumbnail:: /img/cloud/security/pro-tab-apilimits.png
|
||||
:alt: Hasura Cloud Console api limit tab
|
||||
|
||||
.. admonition:: Admin & IntrospectionQuery exemptions
|
||||
|
||||
All API limits are **not** applied for the admin role, and depth limits are **NOT** applied to introspection queries
|
||||
|
||||
Quick-create limits
|
||||
-------------------
|
||||
|
||||
Hasura Cloud lets you add limits with one click from the list of past operations.
|
||||
|
||||
.. thumbnail:: /img/cloud/security/pro-tab-apilimit-config.png
|
||||
:alt: Hasura Cloud Console create new api limit
|
140
docs/cloud/api-reference.rst
Normal file
@ -0,0 +1,140 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud API reference
|
||||
:keywords: hasura, cloud, docs, API, API reference
|
||||
|
||||
.. _cloud_api_reference:
|
||||
|
||||
API Reference
|
||||
=============
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Hasura Cloud provides a GraphQL API to interact with the services to create
|
||||
and manage your projects.
|
||||
|
||||
You can use any GraphQL client and use the API with the right authentication header.
|
||||
|
||||
.. note::
|
||||
|
||||
Please note that the API is still in beta and might change before the
|
||||
stable release.
|
||||
|
||||
Endpoint
|
||||
--------
|
||||
|
||||
API endpoint is ``https://data.pro.hasura.io/v1/graphql``.
|
||||
|
||||
Authentication
|
||||
--------------
|
||||
|
||||
Authentication is done using a Personal Access Token that you can create from
|
||||
the Hasura Cloud Dashboard. You can find this option under the "Settings" tab.
|
||||
|
||||
Once you have the token it can be used with the header:
|
||||
``Authorization: pat <token>``.
|
||||
|
||||
.. note::
|
||||
|
||||
This token can be used to authenticate against Hasura Cloud APIs and your Hasura Cloud projects.
|
||||
Make sure you keep it secure. The token will be valid until you delete it from the dashboard.
|
||||
|
||||
APIs
|
||||
----
|
||||
|
||||
Each Hasura Cloud project is backed by an API entity called "Tenant", with a
|
||||
distinct "Tenant ID" which is different from "Project ID". Each Project is
|
||||
associated with a Tenant. In some cases, like Metrics API, the Project ID is
|
||||
used instead of Tenant ID.
|
||||
|
||||
List of APIs:
|
||||
|
||||
.. contents::
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Create a Tenant
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: graphql
|
||||
|
||||
mutation createProject {
|
||||
createTenant(
|
||||
cloud: "aws"
|
||||
region: "us-east-2"
|
||||
databaseUrl: "postgres://username:password@database-host.com:5432/dbname"
|
||||
) {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
|
||||
Get Tenant details
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: graphql
|
||||
|
||||
query getTenantDetails {
|
||||
tenant_by_pk(
|
||||
id: "7a79cf94-0e53-4520-a560-1b02bf522f08"
|
||||
) {
|
||||
id
|
||||
slug
|
||||
project {
|
||||
id
|
||||
endpoint
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Delete a Tenant
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: graphql
|
||||
|
||||
mutation deleteTenant {
|
||||
deleteTenant(
|
||||
tenantId: "7a79cf94-0e53-4520-a560-1b02bf522f08"
|
||||
) {
|
||||
status
|
||||
}
|
||||
}
|
||||
|
||||
Get ENV Vars
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: graphql
|
||||
|
||||
query getTenantENV {
|
||||
getTenantEnv(
|
||||
tenantId: "7a79cf94-0e53-4520-a560-1b02bf522f08"
|
||||
) {
|
||||
hash
|
||||
envVars
|
||||
}
|
||||
}
|
||||
|
||||
Update ENV Vars
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: graphql
|
||||
|
||||
mutation updateTenantEnv {
|
||||
updateTenantEnv(
|
||||
tenantId: "7a79cf94-0e53-4520-a560-1b02bf522f08"
|
||||
currentHash: "6902a395d70072fbf8d36288f0eacc36c9d82e68"
|
||||
envs: [
|
||||
{key: "HASURA_GRAPHQL_ENABLE_CONSOLE", value: "true"},
|
||||
{key: "ACTIONS_ENDPOINT", value: "https://my-actions-endpoint.com/actions"}
|
||||
]
|
||||
) {
|
||||
hash
|
||||
envVars
|
||||
}
|
||||
}
|
93
docs/cloud/getting-started/index.rst
Normal file
@ -0,0 +1,93 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud getting started
|
||||
:keywords: hasura, docs, cloud, signup
|
||||
|
||||
.. _cloud_getting_started:
|
||||
|
||||
Getting Started with Hasura Cloud
|
||||
=================================
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Step 1: Create an account
|
||||
-------------------------
|
||||
|
||||
Navigate to `cloud.hasura.io
|
||||
<https://cloud.hasura.io/login>`__, and create a new Hasura Cloud account.
|
||||
|
||||
.. _cloud_connect_db:
|
||||
|
||||
Step 2: Connect new/existing database
|
||||
-------------------------------------
|
||||
|
||||
- To use an existing database, choose ``I have an existing Postgres database``.
|
||||
- To create a new database, choose ``Try a free database with Heroku``.
|
||||
|
||||
.. thumbnail:: /img/cloud/getting-started/connect-db.png
|
||||
:alt: Connect new or existing database
|
||||
:width: 591px
|
||||
|
||||
Step 2a: Enter database URL (for existing database)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If you chose ``I have an existing Postgres database`` in :ref:`Step 2 <cloud_connect_db>`, enter a database URL.
|
||||
|
||||
.. thumbnail:: /img/cloud/getting-started/connect-existing-db.png
|
||||
:alt: Enter URL for existing database
|
||||
:width: 556px
|
||||
|
||||
Step 3: Create project
|
||||
----------------------
|
||||
|
||||
Click ``Create Project``.
|
||||
|
||||
.. thumbnail:: /img/cloud/getting-started/create-project-new-db.png
|
||||
:alt: Create project for new database
|
||||
:width: 539px
|
||||
:group: create
|
||||
:class: inline-block
|
||||
|
||||
.. thumbnail:: /img/cloud/getting-started/create-project-existing-db.png
|
||||
:alt: Create project for existing database
|
||||
:width: 552px
|
||||
:group: create
|
||||
:class: inline-block
|
||||
|
||||
Next steps
|
||||
----------
|
||||
|
||||
Once you've created your project, you can get started with building with Hasura or manage your project.
|
||||
|
||||
.. contents::
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
.. thumbnail:: /img/cloud/getting-started/project-functionalities.png
|
||||
:alt: Project actions
|
||||
:width: 860px
|
||||
|
||||
|
||||
Explore the Hasura console
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
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>`.
|
||||
|
||||
You can navigate to the ``Pro`` tab to check out the Pro features that Hasura Cloud has set up for you.
|
||||
|
||||
.. thumbnail:: /img/cloud/metrics/pro-tab-overview.png
|
||||
:alt: Hasura Console: Pro tab
|
||||
:width: 1118px
|
||||
|
||||
Manage your project
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Click the gear icon to :ref:`manage your project <manage_project>` (e.g. add collaborators, env vars or custom domains).
|
||||
|
||||
Add an admin secret
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
:ref:`Add an admin secret <secure_project>` to make sure that your GraphQL endpoint and the Hasura console are not publicly accessible.
|
66
docs/cloud/glossary.rst
Normal file
@ -0,0 +1,66 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud glossary
|
||||
:keywords: hasura, docs, cloud, glossary
|
||||
|
||||
.. _glossary:
|
||||
|
||||
Glossary
|
||||
========
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Hasura Cloud Project
|
||||
--------------------
|
||||
|
||||
A Project is an individual GraphQL API hosted by Hasura Cloud. You
|
||||
can create a Project by going to the cloud dashboard and providing
|
||||
a PostgreSQL database URL. You can also provision a database on
|
||||
cloud platforms like Heroku from the Hasura Cloud Dashboard itself.
|
||||
|
||||
Each project is allocated a unique auto-generated name and an ID.
|
||||
You can use this name or ID while communicating to Hasura team
|
||||
regarding this project. Each project is also assigned a GraphQL API
|
||||
endpoint of the format ``https://<project-name>.hasura.app/v1/graphql``.
|
||||
|
||||
Editing the Project name and adding custom domains will be available soon.
|
||||
|
||||
For example, a project might be called ``usable-cobra-29`` with ID
|
||||
``bf0ea856-76a2-42c2-8a91-66ca9b9206e8``.
|
||||
|
||||
Hasura Cloud IP
|
||||
---------------
|
||||
|
||||
A Hasura Cloud IP will be listed on the Hasura Cloud Dashboard for
|
||||
each project. Hasura will be connecting to your database from this IP address.
|
||||
If your database is not exposed to the internet, you must allow connections
|
||||
from this IP address on your firewall settings
|
||||
for Hasura Cloud Project to function properly. Otherwise, Hasura will not
|
||||
be able to connect to your database and the GraphQL API will not be available.
|
||||
|
||||
Hasura Collaborator Token
|
||||
-------------------------
|
||||
|
||||
When you open the Hasura Console on a Cloud Project, you will not be asked to
|
||||
enter the admin secret like Hasura Core version. Instead, you will be
|
||||
automatically logged into the Console via an OAuth2.0 based authorization flow.
|
||||
You will be given the right access based on your permissions for the particular
|
||||
Hasura Cloud Project.
|
||||
|
||||
After the login process is complete, you'll see a new header called
|
||||
``Hasura-Collaborator-Token`` in the "Request Headers" section of GraphiQL.
|
||||
This token is used instead of admin secret to authenticate and authorize
|
||||
all the requests made from the Console. The token is only valid for 5mins
|
||||
and is refreshed silently by the Console. It is to be used only from Console.
|
||||
|
||||
For accessing the API from other clients, use the admin secret or create
|
||||
a Personal Access Token.
|
||||
|
||||
Hasura Client Name
|
||||
------------------
|
||||
|
||||
``Hasura-Client-Name`` will be set to ``hasura-console`` by default. It is
|
||||
used to identify the client who is making the request in Hasura Pro metrics
|
||||
and monitoring tools.
|
70
docs/cloud/hasurapro-cli/index.rst
Normal file
@ -0,0 +1,70 @@
|
||||
.. meta::
|
||||
:description: Hasura Pro CLI
|
||||
:keywords: hasura, docs, command line interface, cli
|
||||
|
||||
.. _hasurapro_cli:
|
||||
|
||||
Hasura Pro CLI
|
||||
==============
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
|
||||
Installing the Hasura Pro CLI
|
||||
-----------------------------
|
||||
|
||||
Hasura Pro CLI is distributed as a plugin to the :ref:`Hasura Core CLI <hasuracli_manual>`
|
||||
|
||||
- Follow the instructions :ref:`here <install_hasura_cli>` to install Hasura Core CLI
|
||||
|
||||
- Then execute the following command to install the Hasura Pro CLI plugin:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
hasura plugins install pro
|
||||
|
||||
- You can verify the installation by executing the ``help`` command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
hasura pro --help
|
||||
|
||||
Authentication with the Hasura Pro CLI
|
||||
--------------------------------------
|
||||
|
||||
All interactions from the CLI to Hasura’s APIs are authenticated using a personal access token generated for your user account.
|
||||
|
||||
To set up a token, execute the following command on the CLI:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
hasura pro login
|
||||
|
||||
This command will show a prompt for entering the personal access token.
|
||||
|
||||
Head to your `Hasura Cloud account settings <https://cloud.hasura.io>`_ to create a new token. You can name it something like "cli". Note that the token will be shown only once and as soon as you copy the token, paste it in your terminal prompt.
|
||||
|
||||
.. admonition:: Keep this token secure!
|
||||
|
||||
This token can be used to authenticate against Hasura Pro APIs and your Hasura Cloud projects. Make sure you keep it secure. This is a one-time operation. The token will be valid until you delete it.
|
||||
|
||||
Upgrading the CLI
|
||||
-----------------
|
||||
|
||||
To upgrade to a newer version, you can use the ``upgrade`` command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
hasura plugins upgrade pro
|
||||
|
||||
Uninstalling the CLI
|
||||
--------------------
|
||||
|
||||
To uninstall the CLI, use the ``uninstall`` command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
hasura plugins uninstall pro
|
74
docs/cloud/index.rst
Normal file
@ -0,0 +1,74 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud documentation
|
||||
:keywords: hasura, docs, manual, graphql engine, cloud, hosted
|
||||
|
||||
.. title:: Hasura Cloud Documentation
|
||||
|
||||
.. _cloud_docs:
|
||||
|
||||
Hasura Cloud Documentation
|
||||
==========================
|
||||
|
||||
`Hasura Cloud <https://cloud.hasura.io/>`__ offers hosted `GraphQL Engine <https://github.com/hasura/graphql-engine>`__
|
||||
projects with extra features for reliability and security. It includes all the :ref:`core features <core_docs>`
|
||||
of GraphQL Engine, while taking care of infrastructure concerns, such as the number of instances, cores, memory, concurrent users, high-availability,
|
||||
realtime monitoring, caching, tracing, and rate-limiting. It supports both new and existing PostgreSQL databases.
|
||||
|
||||
.. container:: toc-list
|
||||
|
||||
.. container:: toc-list-section
|
||||
|
||||
.. container:: toc-list-head
|
||||
|
||||
Basics
|
||||
|
||||
.. container:: toc-list-content
|
||||
|
||||
- :ref:`cloud_getting_started`
|
||||
- :ref:`projects`
|
||||
|
||||
.. container:: toc-list-section
|
||||
|
||||
.. container:: toc-list-head
|
||||
|
||||
Features
|
||||
|
||||
.. container:: toc-list-content
|
||||
|
||||
- :ref:`metrics`
|
||||
- :ref:`api_limits`
|
||||
- :ref:`allow_lists`
|
||||
- :ref:`regression_tests`
|
||||
- :ref:`read_replicas`
|
||||
- :ref:`response_caching`
|
||||
- :ref:`tracing`
|
||||
|
||||
.. container:: toc-list-section
|
||||
|
||||
.. container:: toc-list-head
|
||||
|
||||
Reference
|
||||
|
||||
.. container:: toc-list-content
|
||||
|
||||
- :ref:`cloud_api_reference`
|
||||
- :ref:`glossary`
|
||||
- :ref:`hasurapro_cli`
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:titlesonly:
|
||||
:hidden:
|
||||
|
||||
Getting Started <getting-started/index>
|
||||
projects/index
|
||||
metrics/index
|
||||
api-limits
|
||||
allow-lists
|
||||
regression-tests
|
||||
read-replicas
|
||||
response-caching
|
||||
tracing
|
||||
hasurapro-cli/index
|
||||
api-reference
|
||||
glossary
|
23
docs/cloud/metrics/errors.rst
Normal file
@ -0,0 +1,23 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud error analysis
|
||||
:keywords: hasura, docs, cloud, reliability, errors
|
||||
|
||||
.. _errors:
|
||||
|
||||
Errors
|
||||
======
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Troubleshoot errors quickly with powerful analytical tools and filters:
|
||||
|
||||
.. thumbnail:: /img/cloud/metrics/pro-tab-errors.png
|
||||
:alt: Hasura Cloud Console errors tab
|
||||
|
||||
Drill into a specific operation via the magnifying-glass icon next to the operation summary in the 'Frequent errors' table. You'll be taken to a list of the failed operations, and can choose one to inspect the specific operation content, metadata, and error generated:
|
||||
|
||||
.. thumbnail:: /img/cloud/metrics/inspect-error.png
|
||||
:alt: Hasura Cloud Console inspect a failed operation
|
35
docs/cloud/metrics/index.rst
Normal file
@ -0,0 +1,35 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud metrics
|
||||
:keywords: hasura, docs, cloud, metrics
|
||||
|
||||
.. _metrics:
|
||||
|
||||
Metrics
|
||||
=======
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Hasura Cloud projects include Pro features for enhanced reliability and performance
|
||||
|
||||
.. thumbnail:: /img/cloud/metrics/pro-tab-overview.png
|
||||
:alt: Hasura Cloud Console overview tab
|
||||
|
||||
Learn more
|
||||
----------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:titlesonly:
|
||||
|
||||
overview
|
||||
errors
|
||||
usage
|
||||
operations
|
||||
websockets
|
||||
subscription-workers
|
119
docs/cloud/metrics/operations.rst
Normal file
@ -0,0 +1,119 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud operation analysis
|
||||
:keywords: hasura, docs, cloud, reliability, operations
|
||||
|
||||
.. _operations:
|
||||
|
||||
Operations
|
||||
==========
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Terminology
|
||||
-----------
|
||||
|
||||
**Operation**
|
||||
Any GraphQL (query, mutation, subscription) request made to v1/graphql endpoint of a GraphQL engine instance
|
||||
|
||||
**Operation name**
|
||||
(Optional) Any GraphQL request can be labelled with a name by the client making the query. In this example, *getPollOptions* is the operation name:
|
||||
|
||||
.. code-block:: graphql
|
||||
|
||||
query getPollOptions (
|
||||
poll {
|
||||
options {
|
||||
id
|
||||
name
|
||||
description
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
**Operation ID**
|
||||
A unique, auto-generated hash for each Operation name; can distinguish between different operations executed with the same name
|
||||
|
||||
**Operation type**
|
||||
Whether the operation is a query, mutation, or subscription
|
||||
|
||||
**Request ID**
|
||||
A unique, auto-generated ID for each request, comes from x-request-id HTTP header
|
||||
|
||||
**Websocket ID**
|
||||
A unique ID generated by the server when a websocket connection is established by the client
|
||||
|
||||
**Websocket Operation ID**
|
||||
A unique ID generated by the websocket client for each operation it is sending to the server
|
||||
|
||||
Operations
|
||||
----------
|
||||
|
||||
Processed realtime logs of all requests to the GraphQL Engine. View all and inspect individual operations:
|
||||
|
||||
.. thumbnail:: /img/cloud/metrics/pro-tab-operations.png
|
||||
:alt: Hasura Cloud Console list operations
|
||||
|
||||
.. thumbnail:: /img/cloud/metrics/pro-tab-operations-inspect.png
|
||||
:alt: Hasura Cloud Console inspect operation
|
||||
|
||||
Filtering operations
|
||||
--------------------
|
||||
|
||||
Click on the **Filter** header to open the menu of filter options
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Filter option
|
||||
- Filter type
|
||||
- Example or options
|
||||
* - Time range
|
||||
- timestamps
|
||||
- last hour, last 6 hours, last 12 hours, last 24 hours, or custom range
|
||||
* - Operation ID
|
||||
- string (text field)
|
||||
- 5284946f4e15aa81bc868316d56aa68f
|
||||
* - Operation Name
|
||||
- string (text field)
|
||||
- getPollOptions
|
||||
* - Request ID
|
||||
- string (text field)
|
||||
- e15f7bj9-3b9f-4152-92a4-e745471514af
|
||||
* - Show only errors
|
||||
- boolean (checkbox field)
|
||||
- true or false (default false)
|
||||
* - Websocket ID
|
||||
- string (text field)
|
||||
- def703fc-851f-48e8-8e5c-cbdead37b2fe
|
||||
* - Websocket Operation ID
|
||||
- string (text field)
|
||||
- 110
|
||||
* - Hide introspection query
|
||||
- boolean (checkbox field)
|
||||
- true or false (default false)
|
||||
* - Operation Type
|
||||
- enum (select field)
|
||||
- query, mutation, subscription, all
|
||||
* - Role
|
||||
- enum (select field)
|
||||
- from *x-hasura-user-role*: no role, admin, user, ...
|
||||
* - Error Code
|
||||
- enum (select field)
|
||||
- no error code, access-denied, depth-limit-exceeded, ...
|
||||
* - Client Name
|
||||
- enum (select field)
|
||||
- no client name, hasura-console, hasura-test-runner, ...
|
||||
* - Transport
|
||||
- enum (select field)
|
||||
- http or ws
|
||||
* - Status
|
||||
- enum (select field)
|
||||
- started or closed
|
||||
|
||||
Sorting operations
|
||||
------------------
|
||||
|
||||
Each column in the **Operations List** can be sorted (ascending or descending) just by clicking on it. Very useful for identifying operations with unusually high execution time or response size!
|
18
docs/cloud/metrics/overview.rst
Normal file
@ -0,0 +1,18 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud overview
|
||||
:keywords: hasura, docs, cloud, overview
|
||||
|
||||
.. _overview:
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
The Overview displays aggregate stats over the last hour:
|
||||
|
||||
.. thumbnail:: /img/cloud/metrics/pro-tab-overview.png
|
||||
:alt: Hasura Cloud Console overview tab
|
18
docs/cloud/metrics/subscription-workers.rst
Normal file
@ -0,0 +1,18 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud subscription workers
|
||||
:keywords: hasura, docs, cloud, reliability, subscriptions
|
||||
|
||||
.. _subscription_workers:
|
||||
|
||||
Subscription workers
|
||||
====================
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Subscription workers offers a subscription-worker-specific version of usage statistics:
|
||||
|
||||
.. thumbnail:: /img/cloud/metrics/pro-tab-subscription-workers.png
|
||||
:alt: Hasura Cloud Console subscription workers tab
|
23
docs/cloud/metrics/usage.rst
Normal file
@ -0,0 +1,23 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud usage analysis
|
||||
:keywords: hasura, docs, cloud, reliability, usage
|
||||
|
||||
.. _usage:
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Learn about usage with aggregate summaries and filtering tools:
|
||||
|
||||
.. thumbnail:: /img/cloud/metrics/pro-tab-usage.png
|
||||
:alt: Hasura Cloud Console usage tab
|
||||
|
||||
Drill into an operation via its magnifying-glass icon in the 'Query List' table. You'll be taken to a list of similar operations, and can choose one to inspect for content, metadata, and error generated:
|
||||
|
||||
.. thumbnail:: /img/cloud/metrics/pro-tab-operations-inspect.png
|
||||
:alt: Hasura Cloud Console inspect an operation
|
18
docs/cloud/metrics/websockets.rst
Normal file
@ -0,0 +1,18 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud websockets analysis
|
||||
:keywords: hasura, docs, cloud, reliability, websockets
|
||||
|
||||
.. _websockets:
|
||||
|
||||
Websockets
|
||||
==========
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Websockets is a ws-specific version of usage statistics:
|
||||
|
||||
.. thumbnail:: /img/cloud/metrics/pro-tab-websockets.png
|
||||
:alt: Hasura Cloud Console websockets tab
|
89
docs/cloud/projects/create.rst
Normal file
@ -0,0 +1,89 @@
|
||||
.. meta::
|
||||
:description: Creating projects on Hasura Cloud
|
||||
:keywords: hasura, cloud, docs, start
|
||||
|
||||
.. _create_project:
|
||||
|
||||
Creating projects
|
||||
=================
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 2
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
You can create a new Hasura Cloud project with either a new Postgres database, or an existing Postgres database with a publicly available IP address.
|
||||
|
||||
To begin, navigate to the ``Projects`` page, and click the ``New Project`` link.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/create-new-project.png
|
||||
:alt: create new project button
|
||||
:width: 400
|
||||
|
||||
Creating a project with a new database
|
||||
--------------------------------------
|
||||
|
||||
Hasura Cloud does not host databases, but does provide integrations with which you can create databases on managed cloud providers like Heroku. Integrations for AWS, GCP, and Azure are coming soon.
|
||||
|
||||
To get started, click ``Try with Heroku``, and follow the prompts to authenticate with Heroku. Hasura Cloud will integrate with your Heroku account and manage the initial setup of a dev-tier Postgres instance. You can always upgrade the instance and manage options later through your Heroku account.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/create-project-heroku.png
|
||||
:alt: create new hosted project
|
||||
|
||||
Creating a project with an existing database
|
||||
--------------------------------------------
|
||||
|
||||
To create a new Hasura Cloud project connected to an existing Postgres database, click ``Enter Database URL``, and enter your database connection string (looks like ``postgres://username:password@hostname:port/dbname``).
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/new-project-hosted.png
|
||||
:alt: create new hosted project
|
||||
|
||||
Allowing connections from Hasura Cloud IP
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
For some cloud services, like GCP, you'll need to adjust your Postgres connection settings to allow connections from the Hasura Cloud IP address. You can copy the IP address from either the copy icon in the ``Database Setup`` window, or the ``Hasura Cloud IP`` field on the project's details view. You may also need to disable SSL. Adding custom cert information to a Hasura Cloud instance is not yet available.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/existing-db-setup.png
|
||||
:alt: Existing database setup
|
||||
:width: 568px
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/hasura-cloud-ip.png
|
||||
:alt: Hasura Cloud IP field
|
||||
:width: 1200px
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/gcp-postgres-authorized-network.png
|
||||
:alt: whitelist Hasura instance IP in Postgres settings
|
||||
:width: 727px
|
||||
|
||||
Connecting to a database not exposed over the internet
|
||||
------------------------------------------------------
|
||||
|
||||
`Contact us <https://hasura.io/contact-us/>`__ for VPC peering and on-premise solutions.
|
||||
|
||||
.. _cloud_postgres_permissions:
|
||||
|
||||
Postgres permissions
|
||||
--------------------
|
||||
|
||||
Hasura Cloud works with **Postgres versions 9.5 and above**.
|
||||
|
||||
If you’re running in a controlled environment, you might need to configure
|
||||
Hasura Cloud to use a specific Postgres user that your DBA gives you.
|
||||
|
||||
Apart from the :ref:`Hasura Core Postgres permissions <postgres_permissions>`,
|
||||
Hasura Cloud needs the following extra permissions:
|
||||
|
||||
- (required) Read and write access to ``hdb_pro_catalog`` schema.
|
||||
|
||||
.. code-block:: sql
|
||||
|
||||
-- execute these statements after executing the ones mentioned in Hasura Core docs
|
||||
-- create the schemas required by the hasura cloud system
|
||||
CREATE SCHEMA IF NOT EXISTS hdb_pro_catalog;
|
||||
|
||||
-- make the user an owner of system schemas
|
||||
ALTER SCHEMA hdb_pro_catalog OWNER TO hasurauser;
|
||||
|
19
docs/cloud/projects/delete.rst
Normal file
@ -0,0 +1,19 @@
|
||||
.. meta::
|
||||
:description: Deleting projects on Hasura Cloud
|
||||
:keywords: hasura, docs, delete
|
||||
|
||||
.. _delete_project:
|
||||
|
||||
Deleting projects
|
||||
=================
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
You can delete a project with the ``Delete Project`` button at the bottom of the project's details view.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/projects-delete.png
|
||||
:alt: delete a project
|
||||
:width: 1199px
|
52
docs/cloud/projects/index.rst
Normal file
@ -0,0 +1,52 @@
|
||||
.. meta::
|
||||
:description: Managing teams in Hasura Cloud
|
||||
:keywords: hasura, docs, cloud, teams
|
||||
|
||||
.. _projects:
|
||||
|
||||
Projects & teams
|
||||
================
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The ``Projects`` page show a list of your projects.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/projects-list.png
|
||||
:alt: Projects list
|
||||
:width: 1200px
|
||||
|
||||
For each project, you can:
|
||||
|
||||
- Click the gear icon to :ref:`manage your project <manage_project>`, or
|
||||
- Click ``Launch Console`` to open the Hasura console in your browser, and navigate to the ``Pro`` tab to check out the Pro features that Hasura Cloud has set up for you.
|
||||
|
||||
.. thumbnail:: /img/cloud/getting-started/project-actions.png
|
||||
:alt: Project actions
|
||||
:width: 860px
|
||||
|
||||
.. thumbnail:: /img/cloud/metrics/pro-tab-overview.png
|
||||
:alt: Hasura Console: Pro tab
|
||||
:width: 1118px
|
||||
|
||||
.. note::
|
||||
|
||||
Please see the :ref:`API reference <cloud_api_reference>` to create and manage Hasura Cloud projects programmatically.
|
||||
|
||||
Dig deeper
|
||||
----------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:titlesonly:
|
||||
|
||||
Creating projects <create>
|
||||
Managing projects <manage-projects/index>
|
||||
Securing projects <secure>
|
||||
Deleting projects <delete>
|
||||
|
71
docs/cloud/projects/manage-projects/domains.rst
Normal file
@ -0,0 +1,71 @@
|
||||
.. meta::
|
||||
:description: Managing domains on Hasura Cloud
|
||||
:keywords: hasura, docs, project, domains
|
||||
|
||||
.. _manage_project_domains:
|
||||
|
||||
Domains tab
|
||||
===========
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 2
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
In the ``Domains`` tab, you can see the default Hasura domain, and you have the possibility to add custom domains.
|
||||
|
||||
Adding a custom domain
|
||||
----------------------
|
||||
|
||||
You can add a custom domain to your Hasura Cloud project by following the steps below.
|
||||
|
||||
Step 1: Navigate to add a custom domain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
On the ``Domains`` tab, click on the ``New Custom Domain`` button.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/add-custom-domain.png
|
||||
:alt: Add custom domain
|
||||
:width: 727px
|
||||
|
||||
Step 2: Add your custom domain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Enter your custom domain and click the ``Add`` button.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/choose-custom-domain.png
|
||||
:alt: Choose custom domain
|
||||
:width: 727px
|
||||
|
||||
Step 3: Add the record to your DNS
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
After adding a custom domain, the following window will show up:
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/dns-settings.png
|
||||
:alt: DNS settings
|
||||
:width: 727px
|
||||
|
||||
If you haven't already done so, add the default Hasura domain as a ``CNAME`` record to your DNS.
|
||||
|
||||
Until this is done, the dashboard will show a notice that the DNS validation is pending.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/dns-validation-pending.png
|
||||
:alt: DNS validation pending
|
||||
:width: 727px
|
||||
|
||||
.. note::
|
||||
|
||||
Depending on your DNS provider, it might take up to 24 hours for the DNS record to be added.
|
||||
|
||||
DNS validated
|
||||
-------------
|
||||
|
||||
Once the DNS is validated, the dashboard will update the status with the following notice:
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/dns-validated.png
|
||||
:alt: DNS validated
|
||||
:width: 727px
|
27
docs/cloud/projects/manage-projects/env-vars.rst
Normal file
@ -0,0 +1,27 @@
|
||||
.. meta::
|
||||
:description: Managing env vars on Hasura Cloud
|
||||
:keywords: hasura, docs, project, env vars
|
||||
|
||||
.. _manage_project_env_vars:
|
||||
|
||||
Env vars tab
|
||||
============
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 2
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The ``Env vars`` tab allows setting :ref:`Hasura GraphQL Engine env variables <command-flags>` and adding other custom env variables as well.
|
||||
|
||||
Adding an env var
|
||||
-----------------
|
||||
|
||||
Click on the ``New Env Var`` button and either choose an env var from the dropdown or add a custom env var.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/add-env-var.png
|
||||
:alt: add env var options
|
||||
:width: 1200px
|
31
docs/cloud/projects/manage-projects/general.rst
Normal file
@ -0,0 +1,31 @@
|
||||
.. meta::
|
||||
:description: Managing projects on Hasura Cloud
|
||||
:keywords: hasura, docs, project, general
|
||||
|
||||
.. _manage_project_general:
|
||||
|
||||
General tab
|
||||
===========
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 2
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The ``General`` tab shows the project's general settings.
|
||||
|
||||
General settings
|
||||
----------------
|
||||
|
||||
- **Name**: Unique auto-generated name for the project
|
||||
- **ID**: Unique auto-generated ID for the project
|
||||
- **GraphQL API**: GraphQL endpoint for the project
|
||||
- **Admin Secret**: Secret for securing the GraphQL endpoint
|
||||
- **Owner**: Email of the project owner
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/project-details.png
|
||||
:alt: General tab
|
||||
:width: 1163px
|
36
docs/cloud/projects/manage-projects/index.rst
Normal file
@ -0,0 +1,36 @@
|
||||
.. meta::
|
||||
:description: Managing projects on Hasura Cloud
|
||||
:keywords: hasura, docs, project
|
||||
|
||||
.. _manage_project:
|
||||
|
||||
Managing projects
|
||||
=================
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 2
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
To view a project's details, and manage its teams and environment variables, navigate to the ``Projects`` page and click the gear icon on the project.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/manage-project.png
|
||||
:alt: Manage project
|
||||
:width: 865px
|
||||
|
||||
Managing projects
|
||||
-----------------
|
||||
|
||||
See the below pages for detailed guides on managing projects:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:titlesonly:
|
||||
|
||||
General tab <general>
|
||||
Team tab <team>
|
||||
Env vars tab <env-vars>
|
||||
Domains tab <domains>
|
46
docs/cloud/projects/manage-projects/team.rst
Normal file
@ -0,0 +1,46 @@
|
||||
.. meta::
|
||||
:description: Managing teams on Hasura Cloud
|
||||
:keywords: hasura, docs, project, team
|
||||
|
||||
.. _manage_project_team:
|
||||
|
||||
Team tab
|
||||
========
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 2
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The ``Team`` tab shows the current people with access to the project.
|
||||
|
||||
Add a collaborator
|
||||
------------------
|
||||
|
||||
Click ``New Collaborator`` to invite a new team member.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/team-view.png
|
||||
:alt: Team tab
|
||||
:width: 1146px
|
||||
|
||||
Team roles
|
||||
^^^^^^^^^^
|
||||
|
||||
Team members can have different levels of access in the Hasura console.
|
||||
|
||||
- **Admin** has complete access to all project tools and configurations.
|
||||
- **User** has limited privileges:
|
||||
|
||||
- The ``Execute GraphQL`` permission allows running queries, mutations, and subscriptions.
|
||||
- The ``View Metrics`` permission allows inspecting operation data and the performance dashboard.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/add-collaborator.png
|
||||
:alt: Add collaborator
|
||||
:width: 437px
|
||||
|
||||
.. note::
|
||||
|
||||
Invitations can be accepted or declined via the ``Invitations`` tab of your Hasura Cloud settings.
|
59
docs/cloud/projects/secure.rst
Normal file
@ -0,0 +1,59 @@
|
||||
.. meta::
|
||||
:description: Securing projects on Hasura Cloud
|
||||
:keywords: hasura, docs, project
|
||||
|
||||
.. _secure_project:
|
||||
|
||||
Securing projects
|
||||
=================
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 2
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
To make sure that your GraphQL endpoint and the Hasura console are not publicly accessible, you need to configure an admin secret key.
|
||||
|
||||
Adding an admin secret
|
||||
----------------------
|
||||
|
||||
Step 1: Go to settings
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
On the project overview, click on the settings icon on the top right of the relevant project.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/secure-settings.png
|
||||
:alt: Go to settings
|
||||
:width: 865px
|
||||
|
||||
Step 2: Navigate to env vars
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
On the ``Env vars`` tab, click the button to add a new env var.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/secure-envvars.png
|
||||
:alt: Navigate to env vars
|
||||
:width: 865px
|
||||
|
||||
Step 3: Add an admin secret
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
In the ``Key`` dropdown, choose ``ADMIN_SECRET`` and add the secret in the ``Value`` field. Then click the ``Add`` button.
|
||||
|
||||
.. thumbnail:: /img/cloud/projects/secure-add-envvar.png
|
||||
:alt: Navigate to env vars
|
||||
:width: 865px
|
||||
|
||||
Accessing Hasura
|
||||
----------------
|
||||
|
||||
After setting an admin secret, when you launch the console from the Hasura Cloud dashboard, you'll be authenticated as an admin.
|
||||
If you want to make API calls from outside the console, you need to pass the admin secret as the `x-hasura-admin-secret` request header.
|
||||
|
||||
.. note::
|
||||
|
||||
The admin secret should be treated like a password i.e. it should be kept secret and shouldn't be passed from frontend clients.
|
||||
Refer :ref:`this <authentication>` to set up user authentication.
|
42
docs/cloud/read-replicas.rst
Normal file
@ -0,0 +1,42 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud read replicas
|
||||
:keywords: hasura, docs, cloud, read replicas, connections, pool
|
||||
|
||||
.. _read_replicas:
|
||||
|
||||
Read replicas
|
||||
=============
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Hasura Cloud can load balance queries and subscriptions across read replicas while sending all mutations and metadata API calls to the master.
|
||||
|
||||
Adding read replica urls
|
||||
------------------------
|
||||
|
||||
If you have configured your Postgres instances with replicas, the replica URLs can be added to Hasura using the following environment variable in your project ENV Vars tab:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
HASURA_GRAPHQL_READ_REPLICA_URLS=postgres://user:password@replica-host:5432/db
|
||||
|
||||
If you have multiple replicas, their urls can be added as comma separated values.
|
||||
|
||||
Connection pool parameters
|
||||
--------------------------
|
||||
|
||||
Additional environment variables for connection pools, and for read replicas specifically:
|
||||
|
||||
``HASURA_GRAPHQL_PG_STRIPES``
|
||||
|
||||
``HASURA_GRAPHQL_PG_CONNECTIONS``
|
||||
|
||||
``HASURA_GRAPHQL_CONNECTIONS_PER_READ_REPLICA``
|
||||
|
||||
``HASURA_GRAPHQL_STRIPES_PER_READ_REPLICA``
|
97
docs/cloud/regression-tests.rst
Normal file
@ -0,0 +1,97 @@
|
||||
.. meta::
|
||||
:description: Hasura Cloud regression tests
|
||||
:keywords: hasura, docs, cloud, reliability, regression, migration
|
||||
|
||||
.. _regression_tests:
|
||||
|
||||
Regression tests
|
||||
================
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 2
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Hasura Cloud includes a comprehensive test bench that lets you seamlessly compile a test suite on each project, executable on any GraphQL Engine instance (ex: staging, prod).
|
||||
|
||||
Here's a reference development workflow that is enabled by Hasura Cloud:
|
||||
|
||||
#. Build your database schema and configure Hasura as required by your frontend apps or public GraphQL API.
|
||||
#. Deploy changes to production after testing them.
|
||||
#. Create a regression suite on production.
|
||||
#. Iterate on your GraphQL schema to support new features or edits.
|
||||
|
||||
- Test changes in your dev instance against the production instance’s regression test suite. Fix any issues highlighted by the tests or plan to communicate regressions to affected stakeholders.
|
||||
|
||||
#. Run all changes through a CI/CD pipeline
|
||||
|
||||
- Run Regression tests programmatically for all changes in the team
|
||||
|
||||
#. Promote changes to prod
|
||||
|
||||
.. thumbnail:: /img/cloud/reliability/regression-testing-diagram.png
|
||||
:alt: Regression testing process diagram
|
||||
|
||||
Manage test suites
|
||||
------------------
|
||||
|
||||
Each Hasura Cloud project can be configured with a separate test suite. Ideally, you want to create a regression test suite on an project which has received requests with operations you’d like to continue supporting or ensure are not “broken” - production or a shared QA project which receives operations in your app or, if you have a public GraphQL API, those from your consumers.
|
||||
|
||||
.. thumbnail:: /img/cloud/reliability/regression-tests-suites.png
|
||||
:alt: Manage regression test suites
|
||||
|
||||
Quick-create tests
|
||||
------------------
|
||||
|
||||
Add important operations to your test suite with one click by adding them from your project's operation history:
|
||||
|
||||
.. thumbnail:: /img/cloud/reliability/regression-tests-add-operations.png
|
||||
:alt: Add tests to regression test suites
|
||||
|
||||
Run test suites
|
||||
---------------
|
||||
|
||||
A good development workflow would require that tests be run 1) early in the dev process, and 2) automatically with changes, to ensure changes to the schema don't break functionality.
|
||||
|
||||
A test suite configured on a Hasura Cloud project can be run on the same instance or any other Hasura Cloud project registered to your team, including local ones. This is how we recommend that you incorporate regression tests into your GraphQL engine workflows:
|
||||
|
||||
Run regression tests manually
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Let’s say you’re a developer iterating on a feature and, as part of your work, need to modify your Postgres schema or the Hasura configuration. It is likely that you are doing so by running the console via the Hasura CLI to generate migrations that you can version control. Before committing your changes in git, you should run tests to get an early warning for potential regressions. Your team may want to designate the test suite from your production instance (or a suitable alternative) as the default suite to be used for this, and you can choose to run this test suite on your local or development instance.
|
||||
|
||||
.. thumbnail:: /img/cloud/reliability/regressions-run-prod-tests-on-dev.png
|
||||
:alt: Run regression tests
|
||||
|
||||
For example, if the column ‘title’ (in a typical authors and articles schema) has been modified as part of a feature iteration. Assuming the operation from the previous example is part of the test suite on production, here’s how the feedback on this change looks like:
|
||||
|
||||
.. thumbnail:: /img/cloud/reliability/regression-tests-results.png
|
||||
:alt: Regression test results
|
||||
|
||||
As you can see, one of the tests fails because it expects a field, title, to be part of the type articles - which is something our proposed change just modified and removed support for.
|
||||
|
||||
Run regression tests in CI/CD flow
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. thumbnail:: /img/cloud/reliability/regression-tests-run-cli.png
|
||||
:alt: Run regression tests via CLI
|
||||
|
||||
This command will fetch the entire test suite from Hasura Pro and run the tests against given endpoint using the admin secret and report the result on the terminal. The test run and the results will also be available on the Hasura Console.
|
||||
|
||||
You can use the Hasura Pro CLI to programmatically trigger execution of a test suite in your automated testing setup, typically in CI scripts.
|
||||
|
||||
In order to communicate with Hasura’s APIs, the CLI needs to be configured with an API access token (which you can create via your Hasura Cloud settings). If you want to set the token up on a non-interactive environment, like a CI pipeline, you can obtain a token and then add to ``~/.hasura/pro_config.yaml`` with the following format:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pat: <token>
|
||||
|
||||
|
||||
View test suite results
|
||||
-----------------------
|
||||
|
||||
.. thumbnail:: /img/cloud/reliability/regression-tests-past-runs.png
|
||||
:alt: Regression tests past results
|
66
docs/cloud/response-caching.rst
Normal file
@ -0,0 +1,66 @@
|
||||
.. meta::
|
||||
:description: Query response caching in Hasura Cloud
|
||||
:keywords: hasura, docs, cloud, response, caching
|
||||
|
||||
.. _response_caching:
|
||||
|
||||
Query response caching
|
||||
======================
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Hasura Cloud provides support for caching query responses, in order to
|
||||
improve performance for queries which are executed frequently.
|
||||
|
||||
Cached responses are stored in for a period of time in a LRU (least-recently
|
||||
used) cache, and removed from the cache as needed based on usage.
|
||||
|
||||
A query's response can be cached only if the following conditions hold:
|
||||
|
||||
- The query does not make use of remote schemas or remote joins
|
||||
- The query and any related user permissions do not make use of session variables
|
||||
- The response JSON is under 100KB in size
|
||||
|
||||
Enable caching
|
||||
--------------
|
||||
|
||||
In order to enable caching for a query response, or to return an existing
|
||||
response from the cache (if one exists), simply add the ``@cached`` directive
|
||||
to your query:
|
||||
|
||||
.. code-block:: graphql
|
||||
|
||||
query MyCachedQuery @cached {
|
||||
users {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
|
||||
If the response was cached successfully, the HTTP response will include a
|
||||
``X-Hasura-TTL`` header, whose value indicates the maximum number of seconds
|
||||
for the returned response to remain in the cache.
|
||||
|
||||
Controlling cache lifetime
|
||||
--------------------------
|
||||
|
||||
The maximum lifetime of an entry in the cache can be controlled using the ``ttl``
|
||||
argument to the ``@cached`` query directive. The value is an integer number of seconds:
|
||||
|
||||
.. code-block:: graphql
|
||||
|
||||
query MyCachedQuery @cached(ttl: 120) {
|
||||
users {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
|
||||
By default, a response will be cached with a maximum lifetime of 60 seconds.
|
||||
The maximum allowed value is 300 seconds (5 minutes).
|
98
docs/cloud/tracing.rst
Normal file
@ -0,0 +1,98 @@
|
||||
.. meta::
|
||||
:description: Distributed tracing with Hasura Cloud
|
||||
:keywords: hasura, docs, cloud, tracing
|
||||
|
||||
.. _tracing:
|
||||
|
||||
Distributed tracing
|
||||
=======================
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Hasura Cloud has support for *distributed tracing*, a technique for
|
||||
debugging Hasura in production in the context of the services it works
|
||||
with. These services might include your own Postgres database, any
|
||||
remote schemas, event trigger webhook providers, action providers or
|
||||
authentication hooks. Distributed tracing attempts to give a unified
|
||||
view into the performance characteristics of all of these components of
|
||||
your architecture.
|
||||
|
||||
Visualizing traces
|
||||
------------------
|
||||
|
||||
The Hasura Pro console makes it possible to view Hasura's own tracing
|
||||
data, by opening the details view for an operation in the Operations
|
||||
tab:
|
||||
|
||||
.. thumbnail:: /img/cloud/tracing/tracing-operations-timing.png
|
||||
:alt: View timing data in the Operations tab
|
||||
|
||||
Given that other system components will report their own tracing data to
|
||||
your APM system, and not to Hasura, it is not possible to give a
|
||||
complete picture of a trace, but since Hasura sits in a central position
|
||||
in the architecture of many systems, it can often give a reasonably
|
||||
comprehensive view of the provenance of data in your system.
|
||||
|
||||
For example, Hasura can report interactions with Postgres, remote
|
||||
schemas, event trigger webhooks and action handlers.
|
||||
|
||||
APM system integration
|
||||
----------------------
|
||||
|
||||
Hasura will report trace information to your APM or *application
|
||||
performance monitoring* system, where it can be correlated with similar
|
||||
sources of data from other components of your service architecture.
|
||||
|
||||
If you are considering integrating Hasura with your APM system, please
|
||||
get in touch so that we can help to coordinate that effort.
|
||||
|
||||
Trace propagation
|
||||
-----------------
|
||||
|
||||
At the boundaries between different services, tracing information needs
|
||||
to be shared in order for trace fragments from different systems to be
|
||||
correlated with each other in the APM system. This is called *trace
|
||||
propagation*.
|
||||
|
||||
There are several subtly-incompatible proposals for trace propagation,
|
||||
which can make it difficult to arrange for any two services to work
|
||||
together.
|
||||
|
||||
Propagation to web services
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For propagation during a call to a web service over HTTP, Hasura
|
||||
currently implements the `B3 propagation
|
||||
specification <https://github.com/openzipkin/b3-propagation>`__. This
|
||||
means that we send trace information in various HTTP headers, which
|
||||
should be read and handled by any compatible web services.
|
||||
|
||||
If you are unsure how to implement B3 propagation in your own web
|
||||
service, the simplest thing to do is to read these headers and pass them
|
||||
along to any HTTP services you call which also support B3 propagation,
|
||||
including Hasura itself.
|
||||
|
||||
In particular, if an event trigger webhook or action handler propagates
|
||||
these B3 headers back to Hasura, we will be able to trace the entire
|
||||
interaction.
|
||||
|
||||
Propagation via Postgres
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
There is no standard method for trace propagation via Postgres
|
||||
transactions. For example, event triggers can be invoked by mutations,
|
||||
and so their traces should be correlated.
|
||||
|
||||
For this reason, we have adopted our own method of propagating a trace
|
||||
context in Postgres transactions.
|
||||
|
||||
The trace context will be serialized during mutations as a
|
||||
transaction-local variable, ``hasura.tracecontext``. This value has the
|
||||
Postgres type ``json``, and it can be read in trigger functions and
|
||||
propagated to any downstream services.
|
@ -12,6 +12,9 @@ Config API Reference
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The Config API is an admin only endpoint which gives info on the server
|
||||
configuration.
|
||||
|
||||
|
@ -12,6 +12,9 @@ Explain API Reference
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The Explain API is used to analyse queries and subscriptions. It returns a list of Postgres plans for a query and a single Postgres plan for a subscription, based
|
||||
on the defined permissions.
|
||||
|
||||
|
@ -12,6 +12,9 @@ GraphQL API Reference
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
All GraphQL requests for queries, subscriptions and mutations are made to the GraphQL API.
|
||||
|
||||
Endpoint
|
||||
|
@ -12,6 +12,9 @@ Health check API Reference
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The Health API is a public endpoint which gives info on the server health.
|
||||
|
||||
Endpoint
|
||||
|
@ -12,6 +12,9 @@ PG Dump API Reference
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The PG Dump API is an admin-only endpoint that can be used to execute ``pg_dump`` on the
|
||||
Postgres instance that Hasura is configured with.
|
||||
|
||||
|
@ -14,6 +14,9 @@ API Reference - Supported PostgreSQL Types
|
||||
|
||||
.. _types_table:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
List of PostgreSQL types supported by the Hasura GraphQL engine with their equivalent Hasura types:
|
||||
|
||||
.. csv-table::
|
||||
|
@ -12,6 +12,9 @@ Schema/Metadata API Reference: Actions
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
**actions** are user defined mutations with custom business logic.
|
||||
|
||||
.. _create_action:
|
||||
|
@ -12,6 +12,9 @@ Schema/Metadata API Reference: Computed Fields
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
**computed field** is an extra field added to a table, its value is
|
||||
computed via an SQL function which has the table row type as an input argument.
|
||||
Currenty, the Hasura GraphQL engine supports functions returning
|
||||
|
@ -12,6 +12,9 @@ Schema/Metadata API Reference: Custom Functions
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Track/untrack a custom SQL function in the Hasura GraphQL engine.
|
||||
|
||||
Only tracked custom functions are available for querying/mutating/subscribing data over the GraphQL API.
|
||||
|
@ -7,6 +7,14 @@
|
||||
Schema/Metadata API Reference: Custom Types
|
||||
===========================================
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
**Custom Types** are user-defined GraphQL types which help to define :ref:`Actions <api_actions>`.
|
||||
|
||||
.. _set_custom_types:
|
||||
|
@ -12,6 +12,9 @@ Schema/Metadata API Reference: Event Triggers
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Event triggers are used to capture database changes and send them to a configured webhook.
|
||||
|
||||
.. _create_event_trigger:
|
||||
|
@ -12,6 +12,9 @@ Schema / Metadata API Reference
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The schema / metadata API provides the following features:
|
||||
|
||||
1. Execute SQL on the underlying Postgres database, supports schema modifying actions.
|
||||
|
@ -12,6 +12,9 @@ Schema/Metadata API Reference: Manage metadata
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
APIs to manage Hasura metadata which is stored in ``hdb_catalog`` schema.
|
||||
|
||||
.. _export_metadata:
|
||||
|
@ -12,6 +12,9 @@ Schema/Metadata API Reference: Permissions
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The permission layer is designed to restrict the operations that can be
|
||||
performed by various users. Permissions can be defined on various operations
|
||||
(insert/select/update/delete) at a role level granularity. By default, the ``admin``
|
||||
|
@ -12,6 +12,9 @@ Schema/Metadata API Reference: Query collections
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Group queries using query collections.
|
||||
|
||||
Create/drop query collections and add/drop a query to a collection using the following query types.
|
||||
|
@ -12,6 +12,9 @@ Schema/Metadata API Reference: Relationships
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
When retrieving data from tables, it is very helpful if we can also
|
||||
fetch the related data alongside the columns. This is where relationships come
|
||||
in. They can be considered as pseudo columns for a table to access the related
|
||||
|
@ -10,6 +10,9 @@ Schema/Metadata API Reference: Remote Relationships
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Remote Relationships allow you to join tables with remote schemas.
|
||||
|
||||
.. _create_remote_relationship:
|
||||
|
@ -12,6 +12,9 @@ Schema/Metadata API Reference: Remote schemas
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Add/Remove a remote GraphQL server as remote schema in Hasura GraphQL engine.
|
||||
|
||||
.. _add_remote_schema:
|
||||
|
@ -10,6 +10,9 @@ Schema/Metadata API Reference: Scheduled Triggers
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Scheduled triggers are used to invoke webhooks based on a timestamp or cron.
|
||||
|
||||
.. _create_cron_trigger:
|
||||
|
@ -12,6 +12,9 @@ Schema/Metadata API Reference: Tables/Views
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Track/untrack a table/view in Hasura GraphQL engine.
|
||||
|
||||
Only tracked tables/views are available for querying/mutating/subscribing data over the GraphQL API.
|
||||
|
@ -12,6 +12,8 @@ Version API Reference
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The ``/v1/version`` is a public endpoint that responds with the current server version in JSON format.
|
||||
|
||||
|
@ -12,6 +12,9 @@ Access control examples
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
This is a guide to help you set up a basic authorization architecture for your GraphQL fields. It is recommended
|
||||
that you first check out :ref:`roles_variables` and :ref:`permission_rules`
|
||||
that will be referred to throughout this guide.
|
||||
|
@ -12,6 +12,9 @@ Allow-list of operations
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The **Allow-list** is a list of safe operations (*GraphQL queries, mutations or subscriptions*) that is stored by
|
||||
the GraphQL engine in its metadata. When enabled, it can be used to restrict the GraphQL engine so that it
|
||||
executes **only** those operations that are present in the list *(available after version v1.0.0-beta.1)*.
|
||||
@ -42,7 +45,7 @@ You can add or remove a operation in the allow-list in two ways:
|
||||
to add multiple operations to the allow-list (each operation needs to have a name).
|
||||
|
||||
* **Using metadata APIs:** Queries can be stored in collections and a collection can be added to or removed
|
||||
from the allow-list. See :ref:`Collections & Allow-list APIs<api_query_collections>`
|
||||
from the allow-list. See :ref:`Collections & Allow-list APIs <api_query_collections>`
|
||||
for API reference.
|
||||
|
||||
.. note::
|
||||
|
@ -26,7 +26,7 @@ One-click deployment options
|
||||
|
||||
If you want to take Hasura for a spin and check out the features, the following one-click deployments will be useful for you:
|
||||
|
||||
- `Deploy using Hasura Cloud <https://hasura.io/docs/cloud/1.0/manual/getting-started/index.html>`__ (**recommended**)
|
||||
- :ref:`Deploy using Hasura Cloud <cloud_getting_started>` (**recommended**)
|
||||
- :ref:`Deploy using Heroku <heroku_one_click>`
|
||||
- :ref:`Deploy using Render One-click Deploy with Managed PostgreSQL <deploy_render>`
|
||||
- :ref:`Deploy using Nhost One-click Deploy with Managed PostgreSQL, Storage, and Auth <deploy_nhost>`
|
||||
@ -38,7 +38,7 @@ Deployment guides
|
||||
|
||||
Choose from the full list of deployment guides:
|
||||
|
||||
- `Deploy using Hasura Cloud <https://hasura.io/docs/cloud/1.0/manual/getting-started/index.html>`__ (**recommended**)
|
||||
- :ref:`Deploy using Hasura Cloud <cloud_getting_started>` (**recommended**)
|
||||
- :ref:`Deploy using Docker <deployment_docker>`
|
||||
- :ref:`Deploy using Kubernetes <deploy_kubernetes>`
|
||||
- :ref:`Deploy using Heroku <deploy_heroku>`
|
||||
@ -58,7 +58,7 @@ Choose from the full list of deployment guides:
|
||||
:titlesonly:
|
||||
:hidden:
|
||||
|
||||
Using Hasura Cloud <https://hasura.io/docs/cloud/1.0/manual/getting-started/index.html>
|
||||
Using Hasura Cloud <https://hasura.io/docs/1.0/cloud/getting-started/index.html>
|
||||
Using Docker <docker>
|
||||
Using Kubernetes <kubernetes>
|
||||
Using Heroku (one-click) <heroku>
|
||||
|
@ -12,6 +12,9 @@ GraphQL engine server config examples
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The following are a few configuration use cases:
|
||||
|
||||
.. _add-admin-secret:
|
||||
|
@ -12,6 +12,9 @@ GraphQL engine server configuration
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Hasura supports various flags and options for customising how you are running the GraphQL engine in your environment.
|
||||
|
||||
Server flags
|
||||
|
@ -12,6 +12,9 @@ GraphQL engine server flags reference
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Every GraphQL engine command is structured as:
|
||||
|
||||
.. code-block:: bash
|
||||
@ -21,7 +24,7 @@ Every GraphQL engine command is structured as:
|
||||
The flags can be passed as ENV variables as well.
|
||||
|
||||
Server flags
|
||||
^^^^^^^^^^^^
|
||||
------------
|
||||
|
||||
For the ``graphql-engine`` command these are the available flags and ENV variables:
|
||||
|
||||
@ -67,7 +70,7 @@ Or you can specify the following options *(only via flags)*:
|
||||
.. _command-flags:
|
||||
|
||||
Command flags
|
||||
^^^^^^^^^^^^^
|
||||
-------------
|
||||
|
||||
For the ``serve`` sub-command these are the available flags and ENV variables:
|
||||
|
||||
|
@ -12,6 +12,9 @@ Production checklist
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
This guide is a checklist for configuring and securing GraphQL engine for a
|
||||
production deployment.
|
||||
|
||||
|
@ -18,7 +18,7 @@ configure an admin secret key.
|
||||
Depending on your deployment method, follow one of these guides to configure an admin secret key, and prevent public
|
||||
access to your GraphQL endpoint and the Hasura console:
|
||||
|
||||
- `For Hasura Cloud <https://hasura.io/docs/cloud/1.0/manual/projects/secure.html>`__
|
||||
- :ref:`For Hasura Cloud <secure_project>`
|
||||
- :ref:`For Heroku <heroku_secure>`
|
||||
- :ref:`For Docker <docker_secure>`
|
||||
- :ref:`For Kubernetes <kubernetes_secure>`
|
||||
|
@ -11,6 +11,8 @@ Clean up event data
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Hasura stores event data associated with Event Triggers in the metadata schema. If there are lots of events, the metadata tables can get huge and you may want to prune them. You can use any of the following options to prune your event data depending on your need.
|
||||
|
||||
|
@ -12,6 +12,9 @@ Creating an event trigger
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Event triggers can be created using the Hasura console or metadata APIs.
|
||||
|
||||
Open the Hasura console, head to the ``Events`` tab and click on the ``Create`` button to open the
|
||||
|
@ -12,10 +12,14 @@ Event trigger payload
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The following is the payload and delivery mechanism of an event to the webhook when an event trigger is invoked.
|
||||
|
||||
HTTP request method
|
||||
-------------------
|
||||
|
||||
Delivered over ``HTTP POST`` with the following headers:
|
||||
|
||||
.. code-block:: none
|
||||
|
@ -12,6 +12,9 @@ Using serverless functions
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
You can use serverless functions along with event triggers to design an async business workflow without
|
||||
having to manage any dedicated infrastructure.
|
||||
|
||||
|
@ -12,12 +12,16 @@ Setting up your first event trigger
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
You can use Hasura to setup event triggers that call configured webhooks whenever specific database events occur.
|
||||
|
||||
Let's create a sample event trigger with https://httpbin.org as our simple webhook.
|
||||
|
||||
Create a table
|
||||
--------------
|
||||
|
||||
Head to the Hasura console, navigate to ``Data -> Create table`` and create a sample table called ``profile`` with
|
||||
the following columns:
|
||||
|
||||
@ -33,6 +37,7 @@ the following columns:
|
||||
|
||||
Setup an event trigger
|
||||
----------------------
|
||||
|
||||
In the Hasura console, navigate to ``Events -> Create trigger`` and:
|
||||
|
||||
1. Enter trigger name as ``echo``.
|
||||
|
@ -12,6 +12,9 @@ Making your first GraphQL query
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Let's create a sample table and query data from it using the Hasura console, a UI tool meant for doing exactly this:
|
||||
|
||||
Create a table
|
||||
|
@ -24,7 +24,7 @@ To use the Hasura GraphQL engine, you need to:
|
||||
Get started from scratch
|
||||
------------------------
|
||||
|
||||
- `Using Hasura Cloud <https://hasura.io/docs/cloud/1.0/manual/getting-started/index.html>`__ **(recommended)**: Create
|
||||
- :ref:`Using Hasura Cloud <cloud_getting_started>` **(recommended)**: Create
|
||||
a new Hasura Cloud project with just a few clicks.
|
||||
- :ref:`Using Docker <docker_simple>`: Run a **local development** setup that sets up both the Hasura GraphQL
|
||||
engine and Postgres using Docker Compose.
|
||||
@ -32,7 +32,7 @@ Get started from scratch
|
||||
Get started using an existing database
|
||||
--------------------------------------
|
||||
|
||||
- `Using Hasura Cloud <https://hasura.io/docs/cloud/1.0/manual/getting-started/index.html>`__ **(recommended)**: Create a new Hasura Cloud project connected to an existing Postgres database.
|
||||
- :ref:`Using Hasura Cloud <cloud_getting_started>` **(recommended)**: Create a new Hasura Cloud project connected to an existing Postgres database.
|
||||
- :ref:`Using Docker <deployment_docker>`: Run as a docker container and connect to an existing Postgres
|
||||
database.
|
||||
- :ref:`Using Kubernetes <deploy_kubernetes>`: Run on Kubernetes and connect to an existing Postgres
|
||||
@ -47,7 +47,7 @@ Get started using an existing database
|
||||
:titlesonly:
|
||||
:hidden:
|
||||
|
||||
Hasura Cloud quickstart <https://hasura.io/docs/cloud/1.0/manual/getting-started/index.html>
|
||||
Hasura Cloud quickstart <https://hasura.io/docs/1.0/cloud/getting-started/index.html>
|
||||
Docker quickstart <docker-simple>
|
||||
Using an existing database <using-existing-database>
|
||||
first-graphql-query
|
||||
|
@ -14,7 +14,7 @@ Getting started with an existing database
|
||||
|
||||
Follow one of these guides to set up Hasura GraphQL engine using an existing database:
|
||||
|
||||
- `Using Hasura Cloud <https://hasura.io/docs/cloud/1.0/manual/projects/create.html>`__ **(recommended)**: Create a new Hasura Cloud project connected to an existing Postgres database
|
||||
- :ref:`Using Hasura Cloud <cloud_getting_started>` **(recommended)**: Create a new Hasura Cloud project connected to an existing Postgres database
|
||||
- :ref:`Using Docker <deployment_docker>`: Run as a docker container and connect to an existing Postgres
|
||||
database.
|
||||
- :ref:`Using Heroku <heroku_existing_db>`: Run on Heroku and connect to an existing
|
||||
|
@ -14,6 +14,7 @@ Setting up GraphQL subscriptions using apollo-client
|
||||
|
||||
Setup
|
||||
-----
|
||||
|
||||
This guide assumes you have the basic apollo-client working as per
|
||||
https://www.apollographql.com/docs/react/get-started/ and now you want to enable subscriptions.
|
||||
|
||||
|
@ -12,10 +12,13 @@ OneGraph's AuthGuardian JWT Integration with Hasura GraphQL engine
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
In this guide, we will walk through how to set up AuthGuardian JWT to work with the Hasura GraphQL engine.
|
||||
|
||||
About AuthGuardian
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
------------------
|
||||
|
||||
`AuthGuardian <https://www.onegraph.com/docs/auth_guardian.html>`__
|
||||
is a free service by `OneGraph <https://www.onegraph.com/>`__ that allows you to both add sign-on with dozens of services like GitHub, Twitch, Stripe, Salesforce, and more, and also to easily visually describe authentication and authorization rules for your app, API, or service.
|
||||
@ -23,14 +26,14 @@ is a free service by `OneGraph <https://www.onegraph.com/>`__ that allows you to
|
||||
It will generate JWTs compatible with any service that supports JWTs - like Hasura! And on top of that, AuthGuardian has built-in support for generating Hasura roles to make working with Hasura's permission system as easy as possible.
|
||||
|
||||
Step 1: Create an account
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
-------------------------
|
||||
|
||||
Sign into `OneGraph <https://www.onegraph.com/>`__ with either GitHub or an email/password.
|
||||
|
||||
On the left sidebar, chose "Auth Services" and then "AuthGuardian", and we're ready to start!
|
||||
|
||||
Step 2: Add an auth rule
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
------------------------
|
||||
|
||||
AuthGuardian works with two basic concepts: ``rules`` and ``effects``.
|
||||
|
||||
@ -53,7 +56,7 @@ The second concept, ``rules`` determines whether the ``effects`` are allowed to
|
||||
Let's see how to use these ``rules`` and ``effects`` in action!
|
||||
|
||||
Option 1: Set Hasura ``user_id``
|
||||
--------------------------------
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Let's say you're using GitHub as the primary login for your Hasura app, and that you want to use their GitHub ``user_id`` as a primary key:
|
||||
|
||||
- For the section "When the user on", select ``GitHub`` -> ``login status`` -> ``is true`` ("When this user is logged into GitHub")
|
||||
@ -65,7 +68,7 @@ Let's say you're using GitHub as the primary login for your Hasura app, and that
|
||||
:alt: Set an AuthGuardian JWT with a user id
|
||||
|
||||
Option 2: Set the default Hasura role
|
||||
-------------------------------------
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Next, you want to assign a *default* role for all users, even those who haven't logged in with GitHub yet.
|
||||
|
||||
Add a new rule (the ``+`` button in the top-left), and fill it out:
|
||||
@ -83,7 +86,7 @@ Add a new rule (the ``+`` button in the top-left), and fill it out:
|
||||
Note that AuthGuardian knows that Hasura requires that the ``default role`` *also* appear in the list of ``x-hasura-allowed-roles``, and added it in both places automatically.
|
||||
|
||||
Option 3: Allow additional Hasura roles
|
||||
---------------------------------------
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Now, you want to restrict access to some data in Hasura so that only you and your teammates can read it. We'll use Hasura's permissions to restrict data to those who have an ``admin`` role, and use AuthGuardian's rules to set that role in the JWT to people who belong to your GitHub organization:
|
||||
|
||||
- For the section "When the user is on", select ``GitHub`` -> ``is member of organization named`` -> ``<your org name, e.g. AcmeCo>`` ("When this user is a member of AcmeCo on GitHub")
|
||||
@ -95,7 +98,7 @@ Now, you want to restrict access to some data in Hasura so that only you and you
|
||||
:alt: Set an AuthGuardian JWT with additional roles
|
||||
|
||||
Option 4: Set a session variable
|
||||
--------------------------------
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Hasura can use **session variables** for all sorts of :ref:`powerful cases <dynamic_session_variables>`. AuthGuardian also supports setting these in your JWT!
|
||||
|
||||
Let's say we want to restrict access to some super-interesting data in our Hasura backend to users who have starred a particular GitHub repository:
|
||||
@ -122,7 +125,7 @@ Nice!
|
||||
|
||||
|
||||
Step 3: Generate Hasura's JWT config to securely verify your new tokens
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
-----------------------------------------------------------------------
|
||||
Next we'll configure Hasura to verify our new JWTs - don't worry, AuthGuardian also has built-in support for that!
|
||||
|
||||
- On the left sidebar, click on "JWT Settings" and scroll down to "Configuration generator".
|
||||
@ -144,7 +147,7 @@ The generated config has the following structure:
|
||||
:alt: AuthGuardian lets you copy/paste the required JWT configuration for either Hasura or Hasura-on-Heroku
|
||||
|
||||
Step 4: Test the config and tokens
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
----------------------------------
|
||||
When configuring your permissions in Hasura, it's useful to be able to quickly generate test tokens to make sure everything works as you expect.
|
||||
|
||||
- Copy the JWT that you created in step 2.
|
||||
@ -161,5 +164,5 @@ When configuring your permissions in Hasura, it's useful to be able to quickly g
|
||||
:alt: Test AuthGuardian JWT
|
||||
|
||||
Next Steps
|
||||
^^^^^^^^^^
|
||||
----------
|
||||
AuthGuardian supports much more, including the ability to eject your rules as a pair of GraphQL request and JavaScript function so you can customize the auth as necessary. To read more about it, please visit the `AuthGuardian docs <https://www.onegraph.com/docs/>`__.
|
||||
|
@ -12,10 +12,13 @@ Auth0 JWT Integration with Hasura GraphQL engine
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
In this guide, we will walk through how to set up Auth0 to work with the Hasura GraphQL engine.
|
||||
|
||||
Create an Auth0 Application
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
---------------------------
|
||||
|
||||
- Navigate to the `Auth0 dashboard <https://manage.auth0.com>`__.
|
||||
- Click on the ``Applications`` menu option on the left and then click the ``+ Create Application`` button.
|
||||
@ -26,7 +29,7 @@ Create an Auth0 Application
|
||||
:alt: Create an Auth0 application
|
||||
|
||||
Configure Auth0 Rules & Callback URLs
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
-------------------------------------
|
||||
|
||||
In the settings of the application, add appropriate (e.g: http://localhost:3000/callback) URLs as ``Allowed Callback
|
||||
URLs`` and ``Allowed Web Origins``. Add domain specific URLs as well for production apps (e.g: https://myapp.com/callback).
|
||||
@ -75,7 +78,7 @@ For auth0-spa-js:
|
||||
.. _test-auth0:
|
||||
|
||||
Create an Auth0 API
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
-------------------
|
||||
|
||||
In case you are using auth0-spa-js, you also need to create an API so that the access token issued by Auth0 is following the JWT standard. Read more about this `here <https://auth0.com/docs/tokens/access-tokens#json-web-token-access-tokens>`__.
|
||||
|
||||
@ -96,7 +99,7 @@ In case you are using auth0-spa-js, you also need to create an API so that the a
|
||||
|
||||
|
||||
Test auth0 login and generate sample JWTs for testing
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
-----------------------------------------------------
|
||||
|
||||
You don't need to integrate your UI with auth0 for testing. You can follow the steps below:
|
||||
|
||||
@ -139,7 +142,7 @@ You don't need to integrate your UI with auth0 for testing. You can follow the s
|
||||
|
||||
|
||||
Configure Hasura to use Auth0 Keys
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
----------------------------------
|
||||
|
||||
Auth0 publishes their JWK under:
|
||||
|
||||
@ -194,7 +197,7 @@ escaping new lines.
|
||||
:alt: Generated JWT config
|
||||
|
||||
Add Access Control Rules via Hasura Console
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
-------------------------------------------
|
||||
|
||||
Auth0 is configured and ready to be used in the application. You can now set up access control rules that
|
||||
will automatically get applied whenever a client makes a GraphQL request with the Auth0 token.
|
||||
@ -219,7 +222,7 @@ This can be useful for data that you would like anyone to be able to access and
|
||||
just like any other role.
|
||||
|
||||
Sync Users from Auth0
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
---------------------
|
||||
|
||||
Now that you have created an Auth0 application and can signup/login, you will need a way to sync your users in Postgres as well.
|
||||
All you really need is the Auth0 ``user_id`` in something like a ``users`` table.
|
||||
|
@ -12,6 +12,9 @@ Telemetry Guide/FAQ
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The Hasura GraphQL engine collects anonymous telemetry data that helps the
|
||||
Hasura team in understanding how the product is being used and in deciding
|
||||
what to focus on next.
|
||||
|
@ -14,9 +14,10 @@ Hasura CLI
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
The ``Hasura CLI`` is a command line tool which is the primary mode of managing Hasura projects and migrations.
|
||||
Introduction
|
||||
------------
|
||||
|
||||
.. _hasuractl_installation:
|
||||
The ``Hasura CLI`` is a command line tool which is the primary mode of managing Hasura projects and migrations.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
@ -12,6 +12,9 @@ How Hasura GraphQL engine works
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Given a Postgres database, the Hasura GraphQL engine can automatically generate a GraphQL schema and process GraphQL
|
||||
queries, subscriptions and mutations. Here’s what the Hasura GraphQL engine does under the hood.
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
.. title:: Hasura GraphQL Engine Documentation
|
||||
|
||||
.. _core_docs:
|
||||
|
||||
Hasura GraphQL Engine Documentation
|
||||
===================================
|
||||
|
||||
@ -68,7 +70,7 @@ The Hasura GraphQL engine makes your data instantly accessible over a real-time
|
||||
- :ref:`Basics <migrations_basics>`
|
||||
- :ref:`Setting Up Migrations <migrations_setup>`
|
||||
- :ref:`Managing Metadata <manage_hasura_metadata>`
|
||||
- `Deploy Using Hasura Cloud <https://hasura.io/docs/cloud/1.0/manual/index.html>`__
|
||||
- :ref:`Deploy Using Hasura Cloud <cloud_docs>`
|
||||
- :ref:`Deploy Using Docker <deployment_docker>`
|
||||
- :ref:`Deploy Using Kubernetes <deploy_kubernetes>`
|
||||
|
||||
|
@ -12,8 +12,9 @@ Aggregation queries
|
||||
:depth: 2
|
||||
:local:
|
||||
|
||||
Aggregate fields
|
||||
----------------
|
||||
**Aggregate** fields
|
||||
--------------------
|
||||
|
||||
You can fetch aggregations on columns along with nodes using an aggregation query.
|
||||
|
||||
The **name of the aggregate field** is of the form ``<field-name> + _aggregate``.
|
||||
|
@ -12,6 +12,9 @@ Nested object queries
|
||||
:depth: 2
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
You can use the object (one-to-one) or array (one-to-many) :ref:`relationships <table_relationships>` defined
|
||||
in your schema to make a nested query i.e. fetch data for a type along with data from a nested or related type.
|
||||
|
||||
|
@ -36,14 +36,14 @@ Let's say we want to analyse the following query:
|
||||
|
||||
In order to analyse the performance of a query, you can click on the ``Analyze`` button on the Hasura console:
|
||||
|
||||
.. thumbnail:: ../../../img/graphql/manual/queries/analyze-query.png
|
||||
.. thumbnail:: /img/graphql/manual/queries/analyze-query.png
|
||||
:class: no-shadow
|
||||
:width: 75%
|
||||
:alt: Query analyze button on Hasura console
|
||||
|
||||
The following query execution plan is generated:
|
||||
|
||||
.. thumbnail:: ../../../img/graphql/manual/queries/query-analysis-before-index.png
|
||||
.. thumbnail:: /img/graphql/manual/queries/query-analysis-before-index.png
|
||||
:class: no-shadow
|
||||
:width: 75%
|
||||
:alt: Execution plan for Hasura GraphQL query
|
||||
@ -227,7 +227,7 @@ Let's compare the performance analysis to :ref:`the one before adding the index
|
||||
What was a ``sequential scan`` in the example earlier is now an ``index scan``. ``Index scans`` are usually more performant than ``sequential scans``.
|
||||
We can also see that the ``cost`` of the query is now lower than the one before we added the index.
|
||||
|
||||
.. thumbnail:: ../../../img/graphql/manual/queries/query-analysis-after-index.png
|
||||
.. thumbnail:: /img/graphql/manual/queries/query-analysis-after-index.png
|
||||
:class: no-shadow
|
||||
:width: 75%
|
||||
:alt: Execution plan for Hasura GraphQL query
|
||||
|
@ -12,6 +12,9 @@ Simple object queries
|
||||
:depth: 2
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
You can fetch a single node or multiple nodes of the same type using a simple object query.
|
||||
|
||||
Fetch list of objects
|
||||
|
@ -12,6 +12,9 @@ Schema design basics
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The Hasura GraphQL engine creates GraphQL schema object types and corresponding query/mutation fields with resolvers
|
||||
automatically as we create tables/views in the Postgres database.
|
||||
|
||||
|
@ -12,6 +12,9 @@ Customise auto-generated field names
|
||||
:depth: 2
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
It is possible to override the auto-generated table and column field names exposed over the GraphQL API.
|
||||
|
||||
.. note::
|
||||
|
@ -12,6 +12,9 @@ Setting default values for fields using role-based column presets
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Let's say you want certain fields to have their values set automatically when not explicitly passed using session
|
||||
variables or fixed values when a new row is created with a particular :ref:`user role <roles_variables>`.
|
||||
|
||||
|
@ -12,6 +12,9 @@ Setting default values for fields using Postgres defaults
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
You can set values of certain fields automatically when not explicitly passed to a fixed value, e.g. true for a boolean
|
||||
field, or output of a simple SQL function, e.g. now() for a timestamp field, by setting column default values in the
|
||||
table definition.
|
||||
|
@ -12,6 +12,9 @@ Setting values of fields using SQL functions/stored procedures
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Let's say you want to set the value of some fields as the output of some custom SQL functions or stored procedures.
|
||||
This is useful to set values of fields which depend on other fields passed in the input. E.g. set
|
||||
``submission_time`` of an online quiz as 1 hour from the ``start_time``.
|
||||
|
@ -12,6 +12,9 @@ Exporting the Hasura GraphQL schema
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
If you need to share, introspect or export the GraphQL schema, you can use community tooling such as
|
||||
`graphqurl <https://github.com/hasura/graphqurl>`__, `Apollo CLI <https://github.com/apollographql/apollo-tooling>`__,
|
||||
`get-graphql-schema <https://github.com/prismagraphql/get-graphql-schema>`__, etc.
|
||||
|
@ -12,6 +12,9 @@ Setting up a GraphQL schema using an existing database
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
When you have an existing database with a schema already present, you don't need to create tables or views or run
|
||||
DDL queries through the Hasura console.
|
||||
|
||||
|
@ -12,6 +12,9 @@ Subscriptions sample use cases
|
||||
:depth: 1
|
||||
:local:
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
The following are a few use cases for using subscriptions:
|
||||
|
||||
.. _subscribe_field:
|
||||
|
BIN
docs/img/cloud/getting-started/connect-db.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
docs/img/cloud/getting-started/connect-existing-db.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
docs/img/cloud/getting-started/create-project-existing-db.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
docs/img/cloud/getting-started/create-project-new-db.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
docs/img/cloud/getting-started/project-actions.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
docs/img/cloud/getting-started/project-functionalities.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
docs/img/cloud/metrics/inspect-error.png
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
docs/img/cloud/metrics/pro-tab-errors.png
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
docs/img/cloud/metrics/pro-tab-operations-inspect.png
Normal file
After Width: | Height: | Size: 131 KiB |
BIN
docs/img/cloud/metrics/pro-tab-operations.png
Normal file
After Width: | Height: | Size: 112 KiB |
BIN
docs/img/cloud/metrics/pro-tab-overview.png
Normal file
After Width: | Height: | Size: 58 KiB |