mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 09:51:59 +03:00
a21f6cd648
Changes compared to `/v1alpha1/graphql` * Changed all graphql responses in **/v1/graphql** endpoint to be 200. All graphql clients expect responses to be HTTP 200. Non-200 responses are considered transport layer errors. * Errors in http and websocket layer are now consistent and have similar structure.
99 lines
3.2 KiB
ReStructuredText
99 lines
3.2 KiB
ReStructuredText
API Reference
|
|
=============
|
|
|
|
.. contents:: Table of contents
|
|
:backlinks: none
|
|
:depth: 1
|
|
:local:
|
|
|
|
Available APIs
|
|
--------------
|
|
|
|
+-----------------+----------------------------------------+------------------+
|
|
| API | Endpoint | Access |
|
|
+=================+========================================+==================+
|
|
| GraphQL | :ref:`/v1/graphql <graphql_api>` | Permission rules |
|
|
+-----------------+----------------------------------------+------------------+
|
|
| Legacy GraphQL | :ref:`/v1alpha1/graphql <graphql_api>` | Permission rules |
|
|
+-----------------+----------------------------------------+------------------+
|
|
| Schema/Metadata | :ref:`/v1/query <schema_metadata_api>` | Admin only |
|
|
+-----------------+----------------------------------------+------------------+
|
|
| Version | :ref:`/v1/version <version_api>` | Public |
|
|
+-----------------+----------------------------------------+------------------+
|
|
| Health | :ref:`/healthz <health_api>` | Public |
|
|
+-----------------+----------------------------------------+------------------+
|
|
| PG Dump | :ref:`/v1alpha1/pg_dump <pg_dump_api>` | Admin only |
|
|
+-----------------+----------------------------------------+------------------+
|
|
|
|
.. _graphql_api:
|
|
|
|
GraphQL API
|
|
^^^^^^^^^^^
|
|
|
|
All GraphQL requests for queries, subscriptions and mutations are made to the GraphQL API.
|
|
|
|
See details at :doc:`graphql-api/index`
|
|
|
|
.. _schema_metadata_api:
|
|
|
|
Schema / Metadata API
|
|
^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
Hasura exposes a Schema / Metadata API for managing metadata for permissions/relationships or for directly
|
|
executing SQL on the underlying Postgres.
|
|
|
|
This is primarily intended to be used as an ``admin`` API to manage Hasura schema and metadata.
|
|
|
|
See details at :doc:`schema-metadata-api/index`
|
|
|
|
.. _version_api:
|
|
|
|
Version API
|
|
^^^^^^^^^^^
|
|
|
|
A ``GET`` request to the public ``/v1/version`` endpoint responds with the current server version
|
|
in JSON format:
|
|
|
|
.. code-block:: js
|
|
|
|
{"version": "v1.0.0-alpha01"}
|
|
|
|
.. _health_api:
|
|
|
|
Health check API
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
A ``GET`` request to the public ``/healthz`` endpoint will respond with ``200``
|
|
if GraphQL Engine is ready to serve requests and there are no inconsistencies
|
|
with the metadata. The response will be ``500`` if there are metadata
|
|
inconsistencies and you should use the console or check the server logs to find
|
|
out what the errors are.
|
|
|
|
|
|
.. _pg_dump_api:
|
|
|
|
pg_dump API
|
|
^^^^^^^^^^^
|
|
|
|
The ``/v1alpha1/pg_dump`` is an admin-only endpoint that can be used to execute ``pg_dump`` on the
|
|
Postgres instance connected to Hasura. The ``pg_dump`` CLI tool's argument can
|
|
be passed as POST request body to the API and the response is sent back to the
|
|
client.
|
|
|
|
See details at :doc:`pgdump`
|
|
|
|
Supported PostgreSQL types
|
|
--------------------------
|
|
You can refer to the following to know about all PostgreSQL types supported by the Hasura GraphQL engine:
|
|
|
|
- :doc:`Supported PostgreSQL types <postgresql-types>`
|
|
|
|
.. toctree::
|
|
:maxdepth: 1
|
|
:hidden:
|
|
|
|
GraphQL API <graphql-api/index>
|
|
Schema / Metadata APIs <schema-metadata-api/index>
|
|
PG Dump API <pgdump>
|
|
Supported PostgreSQL types <postgresql-types>
|