mirror of
https://github.com/hasura/graphql-engine.git
synced 2025-01-05 22:34:22 +03:00
parent
9818819151
commit
405f5edb34
@ -61,6 +61,14 @@ The various types of queries are listed in the following table:
|
|||||||
- :ref:`run_sql_args <run_sql_syntax>`
|
- :ref:`run_sql_args <run_sql_syntax>`
|
||||||
- Run SQL directly on Postgres
|
- Run SQL directly on Postgres
|
||||||
|
|
||||||
|
* - :ref:`track_table`
|
||||||
|
- :ref:`TableName <TableName>`
|
||||||
|
- Add a table/view
|
||||||
|
|
||||||
|
* - :ref:`untrack_table`
|
||||||
|
- :ref:`untrack_table_args <untrack_table_syntax>`
|
||||||
|
- Remove a table/view
|
||||||
|
|
||||||
* - :ref:`create_object_relationship`
|
* - :ref:`create_object_relationship`
|
||||||
- :ref:`create_object_relationship_args <create_object_relationship_syntax>`
|
- :ref:`create_object_relationship_args <create_object_relationship_syntax>`
|
||||||
- Define a new object relationship
|
- Define a new object relationship
|
||||||
@ -120,6 +128,7 @@ The various types of queries are listed in the following table:
|
|||||||
**See**
|
**See**
|
||||||
|
|
||||||
- :doc:`Run SQL <run-sql>`
|
- :doc:`Run SQL <run-sql>`
|
||||||
|
- :doc:`Tables/Views <table-view>`
|
||||||
- :doc:`Relationships <relationship>`
|
- :doc:`Relationships <relationship>`
|
||||||
- :doc:`Permissions <permission>`
|
- :doc:`Permissions <permission>`
|
||||||
|
|
||||||
@ -179,6 +188,7 @@ Error codes
|
|||||||
:hidden:
|
:hidden:
|
||||||
|
|
||||||
Run SQL <run-sql>
|
Run SQL <run-sql>
|
||||||
|
Tables/Views <table-view>
|
||||||
Relationships <relationship>
|
Relationships <relationship>
|
||||||
Permissions <permission>
|
Permissions <permission>
|
||||||
Syntax definitions <syntax-defs>
|
Syntax definitions <syntax-defs>
|
||||||
|
@ -8,8 +8,20 @@ TableName
|
|||||||
^^^^^^^^^
|
^^^^^^^^^
|
||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
:class: haskell-pre
|
||||||
|
|
||||||
String
|
String | QualifiedTable_
|
||||||
|
|
||||||
|
QualifiedTable
|
||||||
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. parsed-literal::
|
||||||
|
:class: haskell-pre
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": String,
|
||||||
|
"schema": String
|
||||||
|
}
|
||||||
|
|
||||||
.. _RoleName:
|
.. _RoleName:
|
||||||
|
|
||||||
|
@ -0,0 +1,78 @@
|
|||||||
|
Schema/Metadata API Reference: Tables/Views
|
||||||
|
============================================
|
||||||
|
Add or remove a table/view to Hasura GraphQL Engine's metadata using following API.
|
||||||
|
|
||||||
|
.. Note::
|
||||||
|
|
||||||
|
Only tables/views added to metadata are available for ``querying/mutating/subscribing`` data over **GraphQL** API.
|
||||||
|
|
||||||
|
.. _track_table:
|
||||||
|
|
||||||
|
track_table
|
||||||
|
-----------
|
||||||
|
|
||||||
|
``track_table`` is used to add a table/view.
|
||||||
|
|
||||||
|
Add a table/view ``author``:
|
||||||
|
|
||||||
|
.. code-block:: http
|
||||||
|
|
||||||
|
POST /v1/query HTTP/1.1
|
||||||
|
Content-Type: application/json
|
||||||
|
X-Hasura-Role: admin
|
||||||
|
|
||||||
|
{
|
||||||
|
"type": "track_table",
|
||||||
|
"args": {
|
||||||
|
"schema": "public",
|
||||||
|
"name": "author"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.. _untrack_table:
|
||||||
|
|
||||||
|
untrack_table
|
||||||
|
-------------
|
||||||
|
|
||||||
|
``untrack_table`` is used to remove a table/view.
|
||||||
|
|
||||||
|
Remove a table/view ``author``:
|
||||||
|
|
||||||
|
.. code-block:: http
|
||||||
|
|
||||||
|
POST /v1/query HTTP/1.1
|
||||||
|
Content-Type: application/json
|
||||||
|
X-Hasura-Role: admin
|
||||||
|
|
||||||
|
{
|
||||||
|
"type": "untrack_table",
|
||||||
|
"args": {
|
||||||
|
"table": {
|
||||||
|
"schema": "public",
|
||||||
|
"name": "author"
|
||||||
|
},
|
||||||
|
"cascade": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.. _untrack_table_syntax:
|
||||||
|
|
||||||
|
Args syntax
|
||||||
|
^^^^^^^^^^^
|
||||||
|
|
||||||
|
.. list-table::
|
||||||
|
:header-rows: 1
|
||||||
|
|
||||||
|
* - Key
|
||||||
|
- Required
|
||||||
|
- Schema
|
||||||
|
- Description
|
||||||
|
* - table
|
||||||
|
- true
|
||||||
|
- :ref:`TableName <TableName>`
|
||||||
|
- Name of the table
|
||||||
|
* - cascade
|
||||||
|
- false
|
||||||
|
- Boolean
|
||||||
|
- When set to ``true``, the effect (if possible) is cascaded to any metadata dependent objects (relationships, permissions, templates).
|
Loading…
Reference in New Issue
Block a user