docs: Clarify that aggregations aren't supported for implicit types.

You can't `sum` an `INTERVAL`, unfortunately.

I also removed _docs/.yarnrc_ as it seems to be unused; _docs/.yarnrc.yml_ is the new <del>shit</del> <ins>stuff</ins>.

[NDAT-475]: https://hasurahq.atlassian.net/browse/NDAT-475?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9070
GitOrigin-RevId: bc0290471dfa1b697340cc926824eaa2dd034542
This commit is contained in:
Samir Talwar 2023-05-09 11:02:56 +02:00 committed by hasura-bot
parent 09d14cfc9d
commit b1ed4db28d
6 changed files with 15 additions and 350 deletions

View File

@ -1,5 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
yarn-path ".yarn/releases/yarn-1.22.19.cjs"

View File

@ -1,339 +0,0 @@
.. meta::
:description: Supported MS SQL Server types in the Hasura API
:keywords: hasura, docs, ms sql server types
.. _mssql_types:
MS SQL Server: Supported types
==============================
.. contents:: Table of contents
:backlinks: none
:depth: 1
:local:
.. _ms_sql_server_types_table:
Introduction
------------
List of MS SQL Server types supported by the Hasura GraphQL Engine with their equivalent Hasura types:
.. csv-table::
:file: mssqltypes.csv
:widths: 13, 11, 25, 6
:header-rows: 1
.. _Int:
Int
---
GraphQL default scalar with name **Int**.
E.g.
.. code-block:: graphql
objects: [
{
int_col: 27
}
]
.. _Float:
Float
-----
GraphQL custom scalar type with name **float8**.
E.g.
.. code-block:: graphql
objects: [
{
float_col: 0.8
}
]
.. note::
To avoid loss of data when retrieving IEEE 754 style data from the database,
please refer to the :ref:`server_flag_reference` for instructions on setting
the ``extra_float_digits`` parameter, which has a bad default value in
PostgreSQL 11 and older.
.. _Numeric:
Numeric
-------
GraphQL custom scalar type with name **numeric**.
E.g.
.. code-block:: graphql
objects: [
{
numeric_col: 0.00000008
}
]
.. _Bool:
Bool
----
GraphQL default Scalar with name **Boolean**. The **Boolean** scalar type represents ``true`` or ``false``.
E.g.
.. code-block:: graphql
objects: [
{
is_published: true
}
]
.. _Char:
Char
----
GraphQL custom scalar with name **character**. It is a ``String`` with single character.
E.g.
.. code-block:: graphql
objects: [
{
char_column: "a"
}
]
.. _String:
String
------
GraphQL default scalar with name **String**. The **String** scalar type represents textual data, represented as UTF-8 character sequences.
The String type is most often used by GraphQL to represent free-form human-readable text.
E.g.
.. code-block:: graphql
objects: [
{
name: "Raven"
}
]
.. _Date:
Date
----
GraphQL custom scalar with name **date**. Date (no time of day). Allowed values are yyyy-mm-dd.
E.g.
.. code-block:: graphql
objects: [
{
date: "1996-03-15"
}
]
.. _Timetz:
Time with time zone
-------------------
GraphQL custom scalar type with name **timetz**. Time of day only, with time zone. Allowed values should be of ISO8601 format
(e.g. 17:30:15Z, 17:30:15+05:30, 17:30:15.234890+05:30).
E.g.
.. code-block:: graphql
objects: [
{
time: "17:30:15+05:30"
}
]
.. _Timestamptz:
Timestamp with time zone
------------------------
GraphQL custom scalar type with name **timestamptz**. Both date and time, with time zone. Allowed values should be of ISO8601 format
(e.g. 2016-07-20T17:30:15Z, 2016-07-20T17:30:15+05:30, 2016-07-20T17:30:15.234890+05:30).
E.g.
.. code-block:: graphql
objects: [
{
timestamptz_col: "2016-07-20T17:30:15+05:30"
}
]
.. _JSON:
JSON
----
GraphQL custom scalar type with name **json**. It is a stringified json value.
E.g.
.. code-block:: graphql
objects: [
{
json_col: "{ \"name\": \"raven\" }"
}
]
.. _JSONB:
JSONB
-----
GraphQL custom scalar type with name **jsonb**. Value should be given through a variable of type **jsonb**.
E.g.
.. code-block:: graphql
mutation insert_test($value : jsonb) {
insert_test(
objects: [
{
jsonb_col: $value
}
]
) {
affected_rows
returning{
jsonb_col
}
}
}
variables:
.. code-block:: json
{
"value": {
"name": "raven"
}
}
.. _Geometry:
Geometry
--------
GraphQL custom scalar type ``geometry`` is generated for a ``GEOMETRY`` column
on a PostGIS enabled MS SQL Server instance. Value should be given as GeoJSON.
E.g.
.. code-block:: graphql
mutation insertGeometry($point: geometry!) {
insert_test(
objects: [{
geometry_col: $point
}]
) {
affected_rows
returning {
geometry_col
}
}
}
variables:
.. code-block:: json
{
"point": {
"type": "Point",
"coordinates": [0, 0]
}
}
.. _Geography:
Geography
---------
GraphQL custom scalar type ``geography`` is generated for a ``GEOGRAPHY`` column
on a PostGIS enabled MS SQL Server instance. Value should be given as GeoJSON.
E.g.
.. code-block:: graphql
mutation insertGeography($point: geography!) {
insert_test(
objects: [{
geography_col: $point
}]
) {
affected_rows
returning {
geography_col
}
}
}
variables:
.. code-block:: json
{
"point": {
"type": "Point",
"coordinates": [0, 0]
}
}
.. _Implicit:
Implicitly Supported types
--------------------------
All ``Implicit`` types in the :ref:`above table <ms_sql_server_types_table>` are implicitly supported by the GraphQL Engine. You have to
provide the value as a **String**.
E.g. For time without time zone type
In ISO 8601 format
.. code-block:: graphql
objects: [
{
time_col: "04:05:06.789"
}
]
E.g. For macaddr type
.. code-block:: graphql
objects: [
{
macaddr_col: "08:00:2b:01:02:03"
}
]
.. Note::
You can learn more about MS SQL Server data types `here <https://www.postgresql.org/docs/current/static/datatype.html>`__.

View File

@ -20,8 +20,10 @@ You can fetch aggregations on columns along with nodes using an aggregation quer
The **name of the aggregate field** is of the form `<field-name> + _aggregate`.
Common aggregation functions are `count`, `sum`, `avg`, `max`, `min`, etc. You can see the complete specification of the
aggregate field in the [API reference](/api-reference/graphql-api/query.mdx#aggregateobject).
Common aggregation functions are `count`, `sum`, `avg`, `max`, `min`, etc. You
can see the complete specification of the aggregate field in the [API
reference](/api-reference/graphql-api/query.mdx#aggregateobject). Note that not
all aggregation functions are available for all data types.
## Fetch aggregated data of an object

View File

@ -20,8 +20,10 @@ You can fetch aggregations on columns along with nodes using an aggregation quer
The **name of the aggregate field** is of the form `<field-name> + _aggregate`.
Common aggregation functions are `count`, `sum`, `avg`, `max`, `min`, etc. You can see the complete specification of the
aggregate field in the [API reference](/api-reference/graphql-api/query.mdx#aggregateobject).
Common aggregation functions are `count`, `sum`, `avg`, `max`, `min`, etc. You
can see the complete specification of the aggregate field in the [API
reference](/api-reference/graphql-api/query.mdx#aggregateobject). Note that not
all aggregation functions are available for all data types.
:::info Note

View File

@ -20,8 +20,10 @@ You can fetch aggregations on columns along with nodes using an aggregation quer
The **name of the aggregate field** is of the form `<field-name> + _aggregate`.
Common aggregation functions are `count`, `sum`, `avg`, `max`, `min`, etc. You can see the complete specification of the
aggregate field in the [API reference](/api-reference/graphql-api/query.mdx#aggregateobject).
Common aggregation functions are `count`, `sum`, `avg`, `max`, `min`, etc. You
can see the complete specification of the aggregate field in the [API
reference](/api-reference/graphql-api/query.mdx#aggregateobject). Note that not
all aggregation functions are available for all data types.
:::info Note

View File

@ -340,6 +340,9 @@ objects: [
]
```
Typically, implicit types only support reading and writing, but not more complex
operations such as boolean comparisons (except for equality) or aggregations.
:::info Note
You can learn more about PostgreSQL data types [here](https://www.postgresql.org/docs/current/static/datatype.html).