Skip to content

Commit

Permalink
docs: data validations (close #4085) (#4260)
Browse files Browse the repository at this point in the history
  • Loading branch information
marionschleifer authored Apr 27, 2020
1 parent ee7c7b1 commit 3ba344b
Show file tree
Hide file tree
Showing 12 changed files with 385 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ A new CLI migrations image is introduced to account for the new migrations workf
(close #3969) (#4145)

### Bug fixes and improvements

- server: improve performance of replace_metadata tracking many tables (fix #3802)
- server: option to reload remote schemas in 'reload_metadata' API (fix #3792, #4117)
- server: fix various space leaks to avoid excessive memory consumption
Expand Down Expand Up @@ -361,3 +362,4 @@ Read more about it in the [docs](https://hasura.io/docs/1.0/graphql/manual/auth/
- server: check expression in update permissions (close #384) (rfc #3750) (#3804)
- console: show pre-release update notifications with opt out option (#3888)
- console: handle invalid keys in permission builder (close #3848) (#3863)
- docs: add page on data validation to docs (close #4085) (#4260)
4 changes: 2 additions & 2 deletions docs/graphql/manual/schema/computed-fields.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ What are computed fields?
-------------------------

Computed fields are virtual values or objects that are dynamically computed and can be queried along with a table's
columns. Computed fields are computed when requested for via SQL functions using other columns of the table and other
custom inputs if needed.
columns. Computed fields are computed when requested for via `custom SQL functions <https://www.postgresql.org/docs/current/sql-createfunction.html>`__
using other columns of the table and other custom inputs if needed.

.. note::

Expand Down
16 changes: 10 additions & 6 deletions docs/graphql/manual/schema/custom-functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

.. _custom_sql_functions:

Customise schema with SQL functions
===================================
Extend schema with SQL functions
================================

.. contents:: Table of contents
:backlinks: none
Expand All @@ -18,15 +18,19 @@ What are custom SQL functions?
Custom SQL functions are `user-defined SQL functions <https://www.postgresql.org/docs/current/sql-createfunction.html>`_
that can be used to either encapsulate some custom business logic or extend the built-in SQL functions and operators.

Hasura GraphQL engine lets you expose certain types of custom functions over the GraphQL API to allow querying them
using both ``queries`` and ``subscriptions``.
Hasura GraphQL engine lets you expose certain types of custom functions as top level fields in the GraphQL API to allow
querying them using both ``queries`` and ``subscriptions``.

.. note::

Custom SQL functions can also be queried as :ref:`computed fields <computed_fields>` of tables.

.. _supported_sql_functions:

Supported SQL functions
-----------------------
***********************

Currently, only functions which satisfy the following constraints can be exposed over the GraphQL API
Currently, only functions which satisfy the following constraints can be exposed as top level fields in the GraphQL API
(*terminology from* `Postgres docs <https://www.postgresql.org/docs/current/sql-createfunction.html>`__):

- **Function behaviour**: ONLY ``STABLE`` or ``IMMUTABLE``
Expand Down
Loading

0 comments on commit 3ba344b

Please sign in to comment.