2020-03-02 13:39:56 +03:00
# Hasura GraphQL Engine Changelog
2020-04-01 12:55:28 +03:00
## Next release
2022-03-17 23:53:56 +03:00
2022-04-13 11:48:26 +03:00
### Bug fixes and improvements
2022-04-13 19:07:12 +03:00
- server: fix parsing remote relationship json definition from 1.x server catalog on migration (fix #7906 )
2022-04-18 09:24:03 +03:00
- server: update pg_dump to be compatible with postgres 14 (#7676)
2022-04-13 11:48:26 +03:00
## v2.6.0-beta.1
2022-04-11 20:49:25 +03:00
### Breaking changes
- The `query` and `raw-query` field from http-logs for metadata requests are removed by default. Use
`HASURA_GRAPHQL_ENABLE_METADATA_QUERY_LOGGING` to renable those fields.
2022-04-13 20:08:46 +03:00
- server: Fix BigQuery overflow issue when using Decimal/NUMERIC data
type. The Hasura Graphql Engine renders the column value as string instead
of numeric value to avoid precision loss. If your endpoint was
returning this result:
``` json
{
"data": {
"hasura_author": [
{
"name": "Author 3",
"tax_id": 44403
}
]
}
}
```
It would now instead return this:
``` json
{
"data": {
"hasura_author": [
{
"name": "Author 3",
"tax_id": "44403"
}
]
}
}
```
Note that the column type of `tax_id` is Decimal and in the second
case it is represented as string.
2022-04-11 20:49:25 +03:00
2022-03-30 10:32:38 +03:00
### Bug fixes and improvements
2022-04-12 17:29:18 +03:00
- server: remove 'query' and 'raw-query' field from logs for metadata queries by default. Use `HASURA_GRAPHQL_ENABLE_METADATA_QUERY_LOGGING` to renable those fields.
2022-04-13 11:48:26 +03:00
- server: `clear_metadata` now correctly archives event triggers and the drop source API drops indirect dependencies created by remote relationships when the dependent source is dropped.
- server: fix inserting values into columns with case sensitive enum types for PostgreSQL/Citus backends (fix #4014 )
- server: remote relationships can be defined _on_ and _to_ Microsoft SQL Server tables
- server: fix issues with JSON key encoding for remote schemas (fixes #7543 and #8200 )
- server: fix Microsoft SQL Server insert mutation when relationships are used in check permissions (fix #8225 )
- server: refactor GraphQL query static analysis and improve OpenAPI warning messages
- server: avoid a resource leak when connecting to PostgreSQL fails
- console: add support for setting aggregation query permissions for Microsoft SQL Server
- console: add support for RS-to-DB and RS-to-RS joins to Remote Schemas tab
- console: removed the need for clicking the Modify btn before editing a remote schema (#1193, #8262 )
2022-03-31 11:27:00 +03:00
- cli: fix remote schema metadata formatting issues (#7608)
2022-03-31 17:01:47 +03:00
- cli: fix query collections metadata formatting issues (#7616)
2022-04-05 11:49:47 +03:00
- docs: support for `graphql-ws` is considered GA
2022-03-31 11:27:00 +03:00
2022-04-13 11:48:26 +03:00
## v2.5.0
2022-03-30 10:32:38 +03:00
2022-03-17 23:53:56 +03:00
### Remote relationships from remote schemas
This release adds three new metadata API commands:
- `create_remote_schema_remote_relationship`
- `update_remote_schema_remote_relationship`
- `delete_remote_schema_remote_relationship`
that allows to create remote relationships between remote schemas on
the left-hand side and databases or remote schemas on the right-hand
side. Both use the same syntax as remote relationships from databases:
```yaml
type: create_remote_schema_remote_relationship
args:
remote_schema: LeftHandSide
type_name: LeftHandSideTypeName
name: RelationshipName
definition:
to_remote_schema:
remote_schema: RightHandSideSchema
lhs_fields: [LHSJoinKeyName]
remote_field:
rhsFieldName:
arguments:
ids: $LHSJoinKeyName
type: create_remote_schema_remote_relationship
args:
remote_schema: LeftHandSide
type_name: LeftHandSideTypeName
name: RelationshipName
definition:
to_source:
source: RightHandSideSource
table: {schema: public, name: RHSTable}
relationship_type: object
field_mapping:
LHSJoinKeyName: RHSColumnName
```
Similarly to DB-to-DB relationships, only `Postgres` is supported on
the right-hand side for now.
2022-03-09 09:34:47 +03:00
### Deprecations
* The `custom_column_names` property of TableConfig used on `<db>_track_table` and `set_table_customization` metadata APIs has been deprecated in favour of the new `column_config` property. `custom_column_names` will still work for now, however, values used in `column_config` will take precedence over values from `custom_column_names` and any overlapped values in `custom_column_names` will be discarded.
2022-03-10 11:12:55 +03:00
### Behaviour Changes
- cli: use indentation of 2 spaces in array elements of metadata YAML files
2022-03-30 07:02:03 +03:00
Example:
< table >
< thead >
< tr >
< th > Old behaviour< pre > metadata/query_collections.yaml< / pre > < / th >
< th > New behaviour< pre > metadata/query_collections.yaml < / pre > < / th >
< / tr >
< / thead >
< tbody >
< tr >
< td >
< pre >
- name: allowed-queries
definition:
queries:
2022-03-10 11:12:55 +03:00
- name: getAlbums
query: |
query getAlbums {
albums {
id
title
}
}
2022-03-30 07:02:03 +03:00
< / pre >
< / td >
< td >
< pre >
- name: allowed-queries
definition:
queries:
- name: getAlbums
query: |
query getAlbums {
albums {
id
title
}
}
< / pre >
< / td >
< / tr >
< / tbody >
< / table >
2022-03-30 16:53:14 +03:00
2022-03-30 07:02:03 +03:00
This change is a result of fixing some inconsistencies and edge cases in writing array elements.
`hasura metadata export` will write YAML files in this format going forward. Also, note that this is a backwards compatible change.
- cli: change ordering of elements in metadata files to match server metadata
Example:
< table >
< thead >
< tr >
< th > Server Metadata (JSON)< / th >
< th > Old behaviour (YAML)< / th >
< th > New Behaviour (YAML)< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td >
< pre >
{
"function": {
"schema": "public",
"name": "search_albums"
}
2022-03-10 11:12:55 +03:00
}
2022-03-30 07:02:03 +03:00
< / pre >
< / td >
< td >
< pre >
function:
name: search_albums
schema: public
< / pre >
< / td >
< td >
< pre >
function:
schema: public
name: search_albums
< / pre >
< / td >
< / tr >
< / tbody >
< / table >
2022-03-10 11:12:55 +03:00
2022-03-02 17:00:22 +03:00
### Bug fixes and improvements
2022-03-30 16:53:14 +03:00
- server: improve error messages in BigQuery upstream API exceptions
2022-03-21 15:14:52 +03:00
- server: Fix regression in MSSQL subscriptions when results exceed 2048 characters (#8267)
Decouple `Analyse` and `OpenAPI` from remote schema introspection and internal execution details.
### Motivation
#2338 introduced a way to validate REST queries against the metadata after a change, to properly report any inconsistency that would emerge from a change in the underlying structure of our schema. However, the way this was done was quite complex and error-prone. Namely: we would use the generated schema parsers to statically execute an introspection query, similar to the one we use for remote schemas, then parse the resulting bytestring as it were coming from a remote schema.
This led to several issues: the code was using remote schema primitives, and was associated with remote schema code, despite being unrelated, which led to absurd situations like creating fake `Variable`s whose type was also their name. A lot of the code had to deal with the fact that we might fail to re-parse our own schema. Additionally, some of it was dead code, that for some reason GHC did not warn about? But more fundamentally, this architecture decision creates a dependency between unrelated pieces of the engine: modifying the internal processing of root fields or the introspection of remote schemas now risks impacting the unrelated `OpenAPI` feature.
### Description
This PR decouples that process from the remote schema introspection logic and from the execution engine by making `Analyse` and `OpenAPI` work on the generic `G.SchemaIntrospection` instead. To accomplish this, it:
- adds `GraphQL.Parser.Schema.Convert`, to convert from our "live" schema back to a flat `SchemaIntrospection`
- persists in the schema cache the `admin` introspection generated when building the schema, and uses it both for validation and for generating the `OpenAPI`.
### Known issues and limitations
This adds a bit of memory pressure to the engine, as we persist the entire schema in the schema cache. This might be acceptable in the short-term, but we have several potential ideas going forward should this be a problem:
- cache the result of `Analyze`: when it becomes possible to build the `OpenAPI` purely with the result of `Analyze` without any additional schema information, then we could cache that instead, reducing the footprint
- caching the `OpenAPI`: if it doesn't need to change every time the endpoint is queried, then it should be possible to cache the entire `OpenAPI` object instead of the schema
- cache a copy of the `FieldParsers` used to generate the schema: as those are persisted through the GraphQL `Context`, and are the only input required to generate the `Schema`, making them accessible in the schema cache would allow us to have the exact same feature with no additional memory cost, at the price of a slightly slower and more complicated process (need to rebuild the `Schema` every time we query the OpenAPI endpoint)
- cache nothing at all, and rebuild the admin schema from scratch every time.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3962
Co-authored-by: paritosh-08 <85472423+paritosh-08@users.noreply.github.com>
GitOrigin-RevId: a8b9808170b231fdf6787983b4a9ed286cde27e0
2022-03-22 10:36:39 +03:00
- server: refactor OpenAPI spec generation (for REST endpoints) and improve OpenAPI warnings
2022-03-30 07:02:03 +03:00
- server: add jsonb to string cast support - postgres (#7818)
2022-03-08 16:02:13 +03:00
- server: improve performance of fetching postgres catalog metadata for tables and functions
2022-03-30 07:02:03 +03:00
- server: Queries present in query collections, such as allow-list and rest-endpoints, are now validated (fixes #7497 )
2022-03-07 13:11:58 +03:00
- server: improve SQL generation for BigQuery backend queries involving `Orderby` .
Fix #3635
In hasura/graphql-engine#5144, we noticed that having remote relationships in the schema is problematic for Relay. In particular, we don't support remote schemas in Relay at all, and because of this, remote relationships were also broken.
The fix was easy: when we're building the schema for Relay, whenever we encounter a remote relationship in our configuration, we simply skip building that field. The implementation was easy: (see hasura/graphql-engine#5145)
```diff
- SFRemoteRelationship info -> pure $ mkRemoteRelationshipFld info
+ SFRemoteRelationship info ->
+ -- https://github.com/hasura/graphql-engine/issues/5144
+ if isRelay then [] else pure $ mkRemoteRelationshipFld info
```
A test case was added in that PR to prevent us from accidentally re-including remote relationships in the Relay schema. (However, it now looks like that test case does not function correctly.)
The above code was later refactored in #3037, making use of the `MaybeT` effect. However, this effect was not used correctly, so that the result of the check was ignored.
This fixes the code to use the `MaybeT` effect correctly.
CC @0x777 @rakeshkky
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3868
GitOrigin-RevId: e528303e01eacf60173cba1eec1898986cf12359
2022-03-03 18:00:23 +03:00
- server: fix regression where remote relationships would get exposed over Relay, which is unsupported
2022-03-09 09:34:47 +03:00
- server: add support for customising the GraphQL schema descriptions of table columns in metadata
2022-03-15 18:16:11 +03:00
- server: column presets for SQL Server were broken and consequently insert and upsert mutations were failing with constraint violations. This change fixes this behavior (#8221).
2022-03-15 08:33:22 +03:00
- server: fix caching bug with session variables in remote joins
2022-03-15 10:35:26 +03:00
- server: fix regression where JWKs are refreshed once per second when both must-revalidate and max-age are specified in the Cache-Control header (#8299)
2022-03-18 13:04:52 +03:00
- server: respect custom field names in delete, insert and update mutations on SQL Server (#8314)
2022-03-30 07:02:03 +03:00
- console: enable searching tables within a schema in the sidebar
2022-03-24 03:29:41 +03:00
- console: add support for setting comments on the custom root fields of tables/views
2022-03-25 12:55:05 +03:00
- console: add feature flags section in settings
2022-03-30 16:53:14 +03:00
- console: improved support for setting comments on computed fields
2022-03-30 07:02:03 +03:00
- console: fix the ability to create updated_at and created_at in the modify page (#8239)
2022-03-30 16:53:14 +03:00
- console: fix an issue where editing both a column's name and its GraphQL field name at the same time caused an error
2022-03-30 07:02:03 +03:00
- console: fix redirect to metadata status page on inconsistent inherited role (#8343)
- console: fix malformed request with REST live preview section (#8316)
2022-04-06 12:20:20 +03:00
- console: fixed actions search to be case-insensitive
2022-03-10 19:45:58 +03:00
- cli: add support for customization field in sources metadata (#8292)
2022-03-30 07:02:03 +03:00
- cli: fix inherited roles metadata not being updated when dropping all roles (#7872)
2022-03-23 14:17:26 +03:00
- ci: ubuntu and centos flavoured graphql-engine images are now available
Fix #3635
In hasura/graphql-engine#5144, we noticed that having remote relationships in the schema is problematic for Relay. In particular, we don't support remote schemas in Relay at all, and because of this, remote relationships were also broken.
The fix was easy: when we're building the schema for Relay, whenever we encounter a remote relationship in our configuration, we simply skip building that field. The implementation was easy: (see hasura/graphql-engine#5145)
```diff
- SFRemoteRelationship info -> pure $ mkRemoteRelationshipFld info
+ SFRemoteRelationship info ->
+ -- https://github.com/hasura/graphql-engine/issues/5144
+ if isRelay then [] else pure $ mkRemoteRelationshipFld info
```
A test case was added in that PR to prevent us from accidentally re-including remote relationships in the Relay schema. (However, it now looks like that test case does not function correctly.)
The above code was later refactored in #3037, making use of the `MaybeT` effect. However, this effect was not used correctly, so that the result of the check was ignored.
This fixes the code to use the `MaybeT` effect correctly.
CC @0x777 @rakeshkky
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3868
GitOrigin-RevId: e528303e01eacf60173cba1eec1898986cf12359
2022-03-03 18:00:23 +03:00
2022-03-30 10:32:38 +03:00
## v2.4.0
### Bug fixes and improvements
- server: add custom function for case insensitive lookup in session variable in request transformation
- server: add metadata inconsistency information in reload_metadata API call
- server: Webhook Transforms can now delete request/response bodies explicitly.
- server: Fix truncation of session variables with variable length column types in MSSQL (#8158)
- server: improve performance of `replace_metadata` for large schemas
- server: improve baseline memory consumption for typical workloads
- server: fix parsing timestamp values in BigQuery backends (fix #8076 )
- server: add support for customising the GraphQL schema descriptions of table root fields
- server: add a `request_headers` field to the `test_webhook_transform` API.
- console: include cron trigger with include in metadata as false on cron trigger manage page
- console: show an error notification if Hasura CLI migrations fail
- console: fixed an issue where cron triggers were not removed from the list after deletion
- console: only show tables from current schema in clone permissions section
- console: provide checkbox to remove body in rest connectors
- cli: fix metadata version being set to 3 when doing `hasura init --version 2` (#8148)
2022-03-23 14:17:26 +03:00
## v2.4.0-beta.3
- server: fix regression in MSSQL subscriptions when results exceed 2048 characters (#8267)
2022-03-17 10:43:31 +03:00
## v2.4.0-beta.2
- server: fix regression where remote relationships would get exposed over Relay, which is unsupported
## v2.3.1
- server: fix regression where remote relationships would get exposed over Relay, which is unsupported
2022-03-07 11:34:12 +03:00
## v2.2.2
- server: fix regression where remote relationships would get exposed over Relay, which is unsupported
2022-03-02 17:00:22 +03:00
## v2.4.0-beta.1
2022-02-16 14:08:51 +03:00
### Bug fixes and improvements
2022-02-17 17:11:44 +03:00
(Add entries below in the order of server, console, cli, docs, others)
2022-02-21 17:47:04 +03:00
2022-03-03 16:33:43 +03:00
- server: add metadata inconsistency information in `reload_metadata` API call
2022-02-24 16:07:32 +03:00
- server: add custom function for case insensitive lookup in session variable in request transformation
2022-03-11 02:22:54 +03:00
- server: Improved error messaging for `test_webhook_transform` metadata API endpoint
2022-03-02 22:42:21 +03:00
- server: Webhook Tranforms can now produce `x-www-url-formencoded` bodies.
2022-02-17 07:36:24 +03:00
- server: Webhook Transforms can now delete request/response bodies explicitly.
2022-02-17 17:11:44 +03:00
- server: Fix truncation of session variables with variable length column types in MSSQL (#8158)
2022-02-24 21:55:23 +03:00
- server: improve performance of `replace_metadata` for large schemas
Build introspection `Schema` ad-hoc at parsing time
In order to respond to GraphQL queries that make use of the introspection fields `__type` or `__schema`, we need two things:
- an overview of the relevant GraphQL type information, stored in a `Schema` object, and
- to have included the `__type` and `__schema` fields in the `query_root` that we generate.
It used to be necessary to do the above items in that order, since the `__type` and `__schema` fields (i.e. the respective `FieldParser`s) were generated _from_ a `Schema` object.
Thanks to recent refactorings in `Hasura.GraphQL.Schema.Introspect` (see hasura/graphql-engine-mono#2835 or hasura/graphql-engine@5760d9289cdf19b1b71f95e4985affdec22f87e1), the introspection fields _themselves_ are now `Schema`-agnostic, and simply return a function that takes a `Schema` object after parsing. For instance, the type of `schema`, corresponding to the `__schema` field, has literally changed as follows:
```diff
-schema :: MonadParse n => Schema -> FieldParser n ( J.Value)
+schema :: MonadParse n => FieldParser n (Schema -> J.Value)
```
This means that the introspection fields can be included in the GraphQL schema *before* we have generated a `Schema` object. In particular, rather than the current architecture of generating `Schema` at startup time for every role, we can instead generate `Schema` ad-hoc at query parsing time, only for those queries that make use of the introspection fields. This avoids us storing a `Schema` for every role for the lifetime of the server.
However: this introduces a functional change, as the code that generates the `Schema` object, and in particular the `accumulateTypeDefinitions` method, also does certain correctness checks, to prevent exposing a spec-incompliant GraphQL schema. If these correctness checks are being done at parsing time rather than startup time, then we catch certain errors only later on. For this reason, this PR adds an explicit run of this type accumulation at startup time. For efficiency reasons, and since this correctness check is not essential for correct operation of HGE, this is done for the admin role only.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3231
GitOrigin-RevId: 23701c548b785929b28667025436b6ce60bfe1cd
2022-02-21 23:23:04 +03:00
- server: improve baseline memory consumption for typical workloads
2022-02-21 17:47:04 +03:00
- server: fix parsing timestamp values in BigQuery backends (fix #8076 )
2022-02-28 10:49:13 +03:00
- server: add support for customising the GraphQL schema descriptions of table root fields
2022-03-02 01:54:47 +03:00
- server: add a `request_headers` field to the `test_webhook_transform` API.
2022-03-03 06:43:27 +03:00
- server: add support for relationships on nested action fields
2022-02-24 14:20:40 +03:00
- console: include cron trigger with include in metadata as false on cron trigger manage page
2022-02-28 13:46:49 +03:00
- console: show an error notification if Hasura CLI migrations fail
2022-03-02 12:27:12 +03:00
- console: fixed an issue where cron triggers were not removed from the list after deletion
2022-03-02 09:10:33 +03:00
- console: only show tables from current schema in clone permissions section
2022-03-01 18:20:59 +03:00
- console: provide checkbox to remove body in rest connectors
2022-02-23 13:51:52 +03:00
- cli: fix metadata version being set to 3 when doing `hasura init --version 2` (#8148)
2022-02-16 14:08:51 +03:00
2022-03-02 17:00:22 +03:00
## v2.3.0
### Experimental SQL optimizations
Row-level permissions are applied by a translation into SQL `WHERE` clauses. If
some tables have similar row-level permission filters, then the generated SQL
may be repetitive and not perform well, especially for GraphQL queries that make
heavy use of relationships.
This version includes an _experimental_ optimization for some SQL queries. It
is expressly experimental, because of the security-sensitive nature of the
transformation that it applies. You should scrutinize the optimized SQL
generated by this feature before using it in production.
The optimization can be enabled using the
`--experimental-features=optimize_permission_filters` flag or the
`HASURA_GRAPHQL_EXPERIMENTAL_FEATURES` environment variable.
### Breaking changes
* Computed field comments are now used as the description for the field in the GraphQL schema. This means that computed fields where the comment has been set to empty string will cause the description of the field in the GraphQL schema to also be blank. Setting the computed field comment to null will restore the previous auto-generated description. The previous version of the Console would set the comment to empty string if the comment textbox was left blank, so some existing computed fields may unintentionally have empty string set as their comment.
### Bug fixes and improvements
- server: validate saved REST endpoint queries wrt schema
- server: improved error reporting for env vars in `test_webhook_transform` metadata API endpoint
- server: extend allowlist metadata with scope information, new command `update_scope_of_allowlist_in_metadata`
- server: (Postgres, Citus, and MSSQL backends) Identity columns and computed
columns are now marked immutable, removing them from the schema of insert and
update mutations.
- server: allow inserting more than 1 row simultaneously into table with generated columns (fix #4633 )
that have generated columns in Postgres.
- server: postgres: return a single entry per row (selected randomly) when an object relationship has multiple matches (fix #7936 )
- server: Updates Kriti to v0.3.0
- server: add operation name in the request sent to remote schemas
- server: add support for scalar response types for actions (fix #7805 )
- server: fix nullable action response (fix #4405 )
- server: add support for customization of table & computed field GraphQL schema descriptions (fix #7496 )
- server: classify MSSQL exceptions and improve API error responses
- server: MSSQL generates correct SQL when object relationships are null.
- console: add support for remote database relationships
- console: enable support for update permissions for mssql
- cli: skip tls verfication for all API requests when `insecure-skip-tls-verify` flag is set (fix #4926 )
- server: fix issues working with read-only DBs by reverting the need for storing required SQL functions in a `hdb_lib` schema in the user's DB
- server: Fix experimental sql optimization read from `HASURA_GRAPHQL_EXPERIMENTAL_FEATURES` or `--experimental-features`
2022-02-28 16:55:59 +03:00
## v2.3.0-beta.3
- server: Fix experimental sql optimization read from `HASURA_GRAPHQL_EXPERIMENTAL_FEATURES` or `--experimental-features`
2022-02-24 13:32:39 +03:00
## v2.2.1
- server: postgres: return a single entry per row (selected randomly) when an object relationship has multiple matches (fix #7936 )
- console: add support for remote database relationships
2022-02-22 16:12:15 +03:00
## v2.3.0-beta.2
- server: fix issues working with read-only DBs by reverting the need for storing required SQL functions in a `hdb_lib` schema in the user's DB
2022-02-16 14:08:51 +03:00
## v2.3.0-beta.1
2022-02-16 01:31:44 +03:00
2022-02-03 19:13:50 +03:00
### Experimental SQL optimizations
Row-level permissions are applied by a translation into SQL `WHERE` clauses. If
some tables have similar row-level permission filters, then the generated SQL
may be repetitive and not perform well, especially for GraphQL queries that make
heavy use of relationships.
This version includes an _experimental_ optimization for some SQL queries. It
is expressly experimental, because of the security-sensitive nature of the
transformation that it applies. You should scrutinize the optimized SQL
generated by this feature before using it in production.
2022-02-07 21:04:35 +03:00
The optimization can be enabled using the
`--experimental-features=optimize_permission_filters` flag or the
`HASURA_GRAPHQL_EXPERIMENTAL_FEATURES` environment variable.
2022-02-03 19:13:50 +03:00
2022-02-16 02:16:34 +03:00
### Breaking changes
* Computed field comments are now used as the description for the field in the GraphQL schema. This means that computed fields where the comment has been set to empty string will cause the description of the field in the GraphQL schema to also be blank. Setting the computed field comment to null will restore the previous auto-generated description. The previous version of the Console would set the comment to empty string if the comment textbox was left blank, so some existing computed fields may unintentionally have empty string set as their comment.
2022-02-02 15:48:57 +03:00
### Bug fixes and improvements
2022-02-16 14:08:51 +03:00
- server: validate saved REST endpoint queries wrt schema
- server: improved error reporting for env vars in `test_webhook_transform` metadata API endpoint
- server: extend allowlist metadata with scope information, new command `update_scope_of_allowlist_in_metadata`
- server: (Postgres, Citus, and MSSQL backends) Identity columns and computed
columns are now marked immutable, removing them from the schema of insert and
update mutations.
2022-02-16 21:33:05 +03:00
- server: allow inserting more than 1 row simultaneously into table with generated columns (fix #4633 )
2022-02-16 14:08:51 +03:00
that have generated columns in Postgres.
2022-02-24 13:32:39 +03:00
- server: postgres: return a single entry per row (selected randomly) when an object relationship has multiple matches (fix #7936 )
2022-02-16 14:08:51 +03:00
- server: Updates Kriti to v0.3.0
2022-02-16 10:54:21 +03:00
- server: add operation name in the request sent to remote schemas
2022-02-16 21:33:05 +03:00
- server: add support for scalar response types for actions (fix #7805 )
- server: fix nullable action response (fix #4405 )
- server: add support for customization of table & computed field GraphQL schema descriptions (fix #7496 )
2022-02-16 14:08:51 +03:00
- server: classify MSSQL exceptions and improve API error responses
2022-02-21 11:52:05 +03:00
- server: MSSQL generates correct SQL when object relationships are null.
2022-02-04 16:55:28 +03:00
- console: add support for remote database relationships
2022-02-16 21:33:05 +03:00
- console: enable support for update permissions for mssql
- cli: skip tls verfication for all API requests when `insecure-skip-tls-verify` flag is set (fix #4926 )
2022-02-07 17:11:49 +03:00
2022-02-02 15:48:57 +03:00
## v2.2.0
2022-02-02 16:45:21 +03:00
### Nested Action Types
Actions now support nested responses as described by associated action types.Example:
```graphql
type Product {
id: bigint!
name: String
}
type ElasticOutput {
products: [Product!]!
aggregations: jsonb
}
```
Previously, nested responses could be encapsulated in a generic "jsonb" output type but this loses precise type information for the API. The current support now allows specifying complex return types for the output.
Currently limits action relationships to top-level fields in the output types.
### GraphQL REST Endpoints OpenAPI Body Specifications
GraphQL REST endpoints are documented via Swagger (OpenAPI) under the `/api/swagger/json` endpoint. We now document the request and response bodies of the endpoints in addition to previous information.
### MS SQL Server Update for Hasura Server
##### Expand Transactions to GraphQL Queries and mssql_run-sql API
Extend transactions to GraphQL queries and mssql_run_sql API
##### Rollback a Transaction Based in the Transaction State
We can query the transaction state using XACT_STATE() scalar function. If the transaction is not active, don't rollback the transaction.
##### Upsert - SQL Generation and Execution
We are translating the if_matched section from the graphql, which is represented by the if_matched type, to a MERGE SQL statement. Example:
```
mutation {
insert_author(
objects: { id: 1, name: "aaa" }
if_matched: { match_columns: author_pkey, update_columns: name }
) {
returning {
id
name
}
}
}
```
2022-01-18 17:53:44 +03:00
### Breaking Changes
- For any **MSSQL** backend, count aggregate query on multiple columns is restricted with a GraphQL
schema change as follows
```diff
count (
--- columns: [table_select_column!]
+++ column: table_select_column
distinct: Boolean
): Int!
```
MSSQL doesn't support applying `COUNT()` on multiple columns.
2022-02-03 19:13:50 +03:00
2022-01-18 17:53:44 +03:00
### Bug fixes and improvements
2022-01-27 21:06:49 +03:00
- server: add a placeholder field to the schema when the `query_root` would be empty
Fix remote relationship invalid type name issue (fix hasura/graphql-engine#8002)
## Description
When setting up a remote relationship to a remote schema, values coming from the left-hand side are given as _arguments_ to the targeted field of the remote schema. In turn, that means we need to adjust the arguments to that remote field; in the case of input objects, it means creating a brand new input object in which the relevant fields have been removed.
To both avoid conflicts, and be explicit, we give a pretty verbose name to such an input object: its original name, followed by "remote_rel", followed by the full name of the field (table name + relationship name). The bug there was introduced when working on extending remote relationships to other backends: we changed the code that translates the table name to a graphql identifier to be generic, and use the table's `ToTxt` instance instead. However, when a table is not in the default schema, the character used by that instance is `.`, which is not a valid GraphQL name.
This PR fixes it, by doing two things:
- it defines a safe function to translate LHS identifiers to graphql names (by replacing all invalid characters by `_`)
- it doesn't use `unsafeMkName` anymore, and checks at validation time that the type name is correct
## Further work
On this PR:
- [x] add a test
- [x] write a Changelog entry
Beyond this PR, we might want to:
- prioritize #1747
- analyze all calls to `unsafeMkName` and remove as many as possible
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3363
GitOrigin-RevId: fe98eb1d34157b2c8323af453f5c369de616af38
2022-01-27 17:32:55 +03:00
- server: fix invalid GraphQL name in the schema arising from a remote relationship from a table in a custom schema
2022-01-27 09:43:39 +03:00
- server: add a new metadata API `get_cron_triggers` to fetch all the cron triggers
2022-01-19 07:46:42 +03:00
- server: add response transforms for actions, events, and triggers
2022-01-18 17:53:44 +03:00
- server: bigquery: implement `distinct_on` .
2022-01-14 17:08:17 +03:00
- server: extend transactions to MSSQL GraphQL queries and `mssql_run_sql` /v2/query API
2022-01-13 14:13:52 +03:00
- server: improve error messages in MSSQL database query exceptions
2022-01-05 11:03:00 +03:00
- server: in mssql transactions, rollback only if the transaction is active
2021-12-22 11:30:15 +03:00
- server: add request and response bodies to OpenAPI specification of REST endpoints
2021-12-31 13:56:06 +03:00
- server: implement upsert mutations for MS SQL Server (close #7864 )
2021-12-22 14:04:33 +03:00
- server: extend support for insert mutations to tables without primary key constraint in a MSSQL backend
2021-12-29 20:15:40 +03:00
- server: fix parsing FLOAT64s in scientific notation and non-finite ones in BigQuery
2021-12-30 12:59:53 +03:00
- server: extend support for the `min` /`max` aggregates to all comparable types in BigQuery
2022-01-14 07:16:42 +03:00
- server: fix support for joins in aggregates nodes in BigQuery
2022-01-24 07:45:44 +03:00
- server: fix for passing input objects in query variables to remote schemas with type name customization (#7977)
2022-01-25 09:27:49 +03:00
- server: fix REST endpoints with path segments not showing correctly in the OpenAPI spec
2022-01-27 08:54:51 +03:00
- server: fix aliases used in GraphQL queries in REST endpoints not being reflected in the OpenAPI spec
2022-01-28 03:17:53 +03:00
- server: refresh JWKs a maximum of once per second (fix #5781 )
2022-01-31 18:29:10 +03:00
- server: implement update mutations for MS SQL Server (closes #7834 )
- server: support nested output object types in actions (#4796)
2022-01-31 09:49:11 +03:00
- server: action webhook requests now include a User-Agent header (fix #8070 )
2022-01-18 17:53:44 +03:00
- console: action/event trigger transforms are now called REST connectors
- console: fix list of tables (and schemas) being unsorted when creating a new trigger event (fix #6391 )
2022-01-28 13:30:32 +03:00
- console: fix custom field names breaking browse table sorting and the pre-populating of the edit row form
2022-01-31 18:29:10 +03:00
- console: enable support for insert & delete permissions for mssql tables
2022-02-02 13:12:43 +03:00
- console: enable inherited role on settings page
2022-01-12 16:24:23 +03:00
- cli: migrate and seed subcommands has an option in prompt to choose and apply operation on all available databases
- cli: fix `metadata diff --type json | unified-json` behaving incorrectly and showing diff in YAML format.
2022-01-12 19:15:52 +03:00
- cli: fix regression in `migrate create` command (#7971)
2022-01-14 07:16:42 +03:00
- cli: stop using `/healthz` endpoint to determine server health
2022-01-20 09:39:58 +03:00
- cli: fix regression with `--address` flag of `hasura console` command (#8005)
2021-12-22 14:04:33 +03:00
2021-12-17 15:37:09 +03:00
## v2.1.1
Fix several issues with remote relationships.
## Remaining Work
- [x] changelog entry
- [x] more tests: `<backend>_delete_remote_relationship` is definitely untested
- [x] negative tests: we probably want to assert that there are some APIs we DON'T support
- [x] update the console to use the new API, if necessary
- [x] ~~adding the corresponding documentation for the API for other backends (only `pg_` was added here)~~
- deferred to https://github.com/hasura/graphql-engine-mono/issues/3170
- [x] ~~deciding which backends should support this API~~
- deferred to https://github.com/hasura/graphql-engine-mono/issues/3170
- [x] ~~deciding what to do about potentially overlapping schematic representations~~
- ~~cf. https://github.com/hasura/graphql-engine-mono/pull/3157#issuecomment-995307624~~
- deferred to https://github.com/hasura/graphql-engine-mono/issues/3171
- [x] ~~add more descriptive versioning information to some of the types that are changing in this PR~~
- cf. https://github.com/hasura/graphql-engine-mono/pull/3157#discussion_r769830920
- deferred to https://github.com/hasura/graphql-engine-mono/issues/3172
## Description
This PR fixes several important issues wrt. the remote relationship API.
- it fixes a regression introduced by [#3124](https://github.com/hasura/graphql-engine-mono/pull/3124), which prevented `<backend>_create_remote_relationship` from accepting the old argument format (break of backwards compatibility, broke the console)
- it removes the command `create_remote_relationship` added to the v1/metadata API as a work-around as part of [#3124](https://github.com/hasura/graphql-engine-mono/pull/3124)
- it reverts the subsequent fix in the console: [#3149](https://github.com/hasura/graphql-engine-mono/pull/3149)
Furthermore, this PR also addresses two other issues:
- THE DOCUMENTATION OF THE METADATA API WAS WRONG, and documented `create_remote_relationship` instead of `<backend>_create_remote_relationship`: this PR fixes this by adding `pg_` everywhere, but does not attempt to add the corresponding documentation for other backends, partly because:
- `<backend>_delete_remote_relationship` WAS BROKEN ON NON-POSTGRES BACKENDS; it always expected an argument parameterized by Postgres.
As of main, the `<backend>_(create|update|delete)_remote_relationship` commands are supported on Postgres, Citus, BigQuery, but **NOT MSSQL**. I do not know if this is intentional or not, if it even should be publicized or not, and as a result this PR doesn't change this.
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3157
Co-authored-by: jkachmar <8461423+jkachmar@users.noreply.github.com>
GitOrigin-RevId: 37e2f41522a9229a11c595574c3f4984317d652a
2021-12-16 23:28:08 +03:00
- server: provides a more comprehensive fix for the JSON ser/de backwards incompatibility that was initially addressed by 45481db (#7906)
2021-12-15 16:55:41 +03:00
2021-12-14 18:37:32 +03:00
## v2.1.0
- server: fix issue interpreting urls from environment in the `TestWebhookTransform` endpoint.
2021-12-14 09:45:13 +03:00
- server: fixes JSON ser/de backwards incompatibility introduced for metadata parsing and 'create_remote_relationship' queries (#7906)
2021-12-14 12:28:20 +03:00
- console: add sample context section to webhook transforms
2021-12-09 20:25:54 +03:00
- cli: `hasura metadata diff` shows diff with more context in directory mode
2021-12-14 18:37:32 +03:00
- cli: revert change to split metadata related to remote schemas into seperate files (introduced in v2.1.0-beta.2)
2021-12-09 20:25:54 +03:00
2021-12-09 14:27:27 +03:00
## v2.1.0-beta.3
2021-12-09 10:58:41 +03:00
- server: allows the use of mock env vars in the `test_webhook_transform` metadata API action
2021-12-14 09:45:13 +03:00
- server: fix event invocation logs to include transformed request bodies
2021-12-02 17:21:42 +03:00
- server: fix aggregate queries with nodes field in selection set for sql server (fix #7871 )
- server: fix permissions are not respected for aggregations in sql server (fix #7773 )
2021-12-01 07:53:34 +03:00
- server: the syntax for remote relationships in metadata is changed to be
consistent with future remote relationships work. However, the older syntax
is still accepted and this is a non-breaking change.
2021-11-19 20:05:01 +03:00
- server: implement delete mutations for MS SQL Server (closes #7626 )
2021-11-11 18:55:32 +03:00
- server: fix JSON path in error when parsing sources in metadata (fix #7769 )
2021-11-09 17:21:48 +03:00
- server: log locking DB queries during source catalog migration
2021-11-10 05:33:58 +03:00
- server: fix to allow remote schema response to contain an "extensions" field (#7143)
2021-11-24 19:21:59 +03:00
- server: support database-to-database joins with BigQuery
2021-11-30 17:46:41 +03:00
- server: improved startup time when using large remote schemas
2021-12-04 00:56:25 +03:00
- server: fix rest-endpoints bug allow list arguments (fix #7135 )
2021-12-08 21:28:36 +03:00
- server: fallback to unauthorized role when JWT is not found in cookie (fix #7272 )
2021-12-09 12:33:24 +03:00
- server: add support for building linux/arm64 docker image (#6337, #1266 )
2021-12-09 14:27:27 +03:00
- server: provide option to explicitly recreate event triggers for sources in the `reload_metadata` API
- server: fix `gen_hasura_uuid` migration to be idempotent, so that it doesn't fail if the database is already initialised with source migrations.
- server: fix mssql `table_by_pk` query returning empty array (fix #7784 )
2021-12-15 18:18:56 +03:00
- server: fix BigQuery queries failing with more than one array relationship
2021-11-09 21:17:04 +03:00
- console: add comments to tracked functions
2021-11-29 15:28:49 +03:00
- console: add select all columns option while selecting the columns in event triggers
2021-11-26 11:49:42 +03:00
- console: add request transforms for events
2021-11-10 08:36:14 +03:00
- metadata SDK: add type definitions for config v3
2021-11-10 15:35:16 +03:00
- cli: fix cli-console failing to add migrations if there are tabs in SQL body (#7362)
2021-12-02 13:20:39 +03:00
- cli: sign windows binary of Hasura CLI (#7147)
2021-11-10 12:21:06 +03:00
- cli: core CLI features are not blocked in environments without internet (#7695)
2022-01-18 16:33:27 +03:00
- server: add `_like` /`_nlike` and spatial operators for BigQuery
2021-11-10 12:21:06 +03:00
2021-11-08 12:25:05 +03:00
## v2.1.0-beta.2
### Action transforms
Action transforms are used to perform transformations on the HTTP request generated by an action.
This allows you to integrate REST APIs or existing APIs without writing a middleware service
that transforms the action's request to the one expected by the API.
2021-10-20 17:26:03 +03:00
2021-11-08 12:25:05 +03:00
Read more in the docs.
2021-10-18 12:16:38 +03:00
2021-10-07 16:02:19 +03:00
### Function field names customization (#7405)
2021-11-08 12:25:05 +03:00
2021-10-07 16:02:19 +03:00
It is now possible to specify the GraphQL names of tracked SQL functions in
Postgres sources, and different names may be given to the `_aggregate` and
suffix-less versions. Aliases may be set by both
`/v1/metadata/pg_track_function` and the new API endpoint
`/v1/metadata/pg_set_function_customization.`
2021-10-29 17:42:07 +03:00
### Root field name and type name customization per source (#6974)
2021-11-08 12:25:05 +03:00
2021-10-29 17:42:07 +03:00
When adding a source it is now possible to specify prefixes and suffixes
that will be added to all root field names and type names generated for that
source. It is also possible to specify a root "namespace" field to use for the
source.
2021-10-22 17:49:15 +03:00
### Bug fixes and improvements
2021-10-07 16:02:19 +03:00
2021-11-08 12:25:05 +03:00
- server: do not recreate event triggers if tables haven't changed on reloading metadata
- server: moves `request_transform` into the Action Definition the `create_action` metadata API call.
- server: call auth webhooks even when the request is malformed JSON or otherwise fails to parse (close #7532 )
- server: updates kriti to v0.2.1 which adds an `escapeUri` function
- server: add cascade option to `mssql_run_sql` metadata API
- server: fix bug which recreated event triggers every time the graphql-engine started up
- server: fix bug in OpenAPI when multiple REST endpoints have the same URL path but different method
2021-10-22 14:53:16 +03:00
- server: add support for GraphQL block strings
2021-10-18 12:16:38 +03:00
- server: Correctly translate permissions on functions to SQL (#7617)
2021-10-13 03:28:51 +03:00
- server: add transformed request to action error responses
2021-10-11 09:55:05 +03:00
- server: allow nullable action responses (#4405)
2021-10-07 16:02:19 +03:00
- server: add support for openapi json of REST Endpoints
2021-10-05 15:28:38 +03:00
- server: enable inherited roles by default in the graphql-engine
2021-10-01 15:52:19 +03:00
- server: support MSSQL insert mutations
2021-10-20 12:54:06 +03:00
- server: fix bug in OpenAPI when multiple REST endpoints have the same URL path but different method
2021-11-09 15:00:21 +03:00
- server: forward Set-Cookie headers from auth webhook
2021-11-08 12:25:05 +03:00
- console: design cleanup Modify and Add Table forms (close #7454 )
- console: enable custom graphql root fields for mssql under modify tab
- console: allow dropping indices on all schemas
- console: fix bug with displaying 1-to-1 relationship with the same column mapping (close #7552 )
- console: add request transforms for actions
2021-10-07 14:24:09 +03:00
- console: fix v2 metadata imports
2021-10-20 12:54:06 +03:00
- console: design cleanup Modify and Add Table forms (close #7454 )
- console: enable custom graphql root fields for mssql under modify tab
2021-11-08 12:25:05 +03:00
- cli: split remote schema permissions metadata into seperate files (#7033)
- cli: support action request transforms in metadata
2021-10-08 16:29:10 +03:00
- cli: make `--database-name` optional in `migrate` subcommands when using a single database (#7434)
2021-10-08 17:43:51 +03:00
- cli: support absolute paths in --envfile (#5689)
2021-10-20 12:54:06 +03:00
- cli: split remote schema permissions metadata into seperate files (#7033)
## v2.0.10
- server: fix bug which recreated event triggers every time the graphql-engine started up
- server: remove identity notion for table columns (fix #7557 )
- console: add performance fixes for handling large db schemas
2021-10-01 15:52:19 +03:00
2021-09-30 12:47:25 +03:00
## v2.1.0-beta.1
2021-09-29 12:53:35 +03:00
- server: Ignore unexpected fields in action responses (#5731)
2021-09-29 11:13:30 +03:00
- server: add webhook transformations for Actions and EventTriggers
2021-09-21 13:39:34 +03:00
- server: optimize SQL query generation with LIMITs
2021-09-20 21:19:39 +03:00
- server: add GraphQL request query in the payload for synchronous actions
2021-09-20 16:14:28 +03:00
- server: improve the event trigger logging on errors
NOTE: This change introduces a breaking change, earlier when there
was a client error when trying to process an event, then the status was reported as 1000. Now, the status 1000 has been removed and if any status was received by the graphql-engine from the webhook, the status
of the invocation will be the same otherwise it will be `NULL` .
- server: support `extensions` field in error responses from action webhook endpoints (fix #4001 )
2021-09-20 13:26:21 +03:00
- server: fix custom-check based permissions for MSSQL (#7429)
2021-10-20 19:14:00 +03:00
- server: query performance improvements
2021-09-17 12:02:06 +03:00
- server: remove identity notion for table columns (fix #7557 )
2021-09-09 10:59:04 +03:00
- server: support MSSQL transactions
2021-09-15 11:29:34 +03:00
- server: log individual operation details in the http-log during a batch graphQL query execution
2021-09-13 21:00:53 +03:00
- server: update `create_scheduled_event` API to return `event_id` in response
2021-09-14 15:02:13 +03:00
- server: fix bug which allowed inconsistent metadata to exist after the `replace_metadata` API even though `allow_inconsistent_object` is set to `false` .
2021-09-15 16:10:42 +03:00
- server: fix explicit `null` values not allowed in nested object relationship inserts (#7484)
2021-09-16 12:06:16 +03:00
- server: `introspect_remote_schema` API now returns original remote schema instead of customized schema
2021-09-16 10:41:52 +03:00
- server: prevent empty subscription roots in the schema (#6898)
2021-09-22 13:43:05 +03:00
- server: support database-to-database joins (for now, limited to Postgres as the target side of the join)
2021-09-24 12:18:40 +03:00
- server: add support for user comments for trackable functions (#7490)
2021-09-15 16:10:42 +03:00
- console: support tracking of functions with return a single row
2021-09-21 10:53:01 +03:00
- console: add GraphQL customisation under Remote schema edit tab
2021-09-22 12:24:17 +03:00
- console: fix cross-schema array relationship suggestions
2021-09-23 17:58:22 +03:00
- console: add performance fixes for handle large db schemas
2021-09-29 16:54:51 +03:00
- console: fix missing cross-schema computed fields in permission builder
2021-10-05 13:48:39 +03:00
- console: add time limits setting to security settings
cli: add support for network metadata object
Issue: https://github.com/hasura/graphql-engine/issues/7520
Problem: add support for network metadata object
Solution: add new network.yaml which consists of network metadata and in code add new network metadata object
Metadata.json
```
{
"resource_version": 6,
"metadata": {
"version": 3,
"sources": [
{
"name": "default",
"kind": "postgres",
"tables": [],
"configuration": {
"connection_info": {
"use_prepared_statements": true,
"database_url": {
"from_env": "HASURA_GRAPHQL_DATABASE_URL"
},
"isolation_level": "read-committed",
"pool_settings": {
"connection_lifetime": 600,
"retries": 1,
"idle_timeout": 180,
"max_connections": 50
}
}
}
}
],
"network": {
"tls_allowlist": [
{
"suffix": null,
"permissions": [
"self-signed"
],
"host": "www.google.com"
},
{
"suffix": null,
"permissions": [
"self-signed"
],
"host": "play.golang.com"
},
{
"suffix": null,
"permissions": [
"self-signed"
],
"host": "hasura.io"
}
]
}
}
}
```
network.yaml
```
tls_allowlist:
- suffix: null
permissions:
- self-signed
host: www.google.com
- suffix: null
permissions:
- self-signed
host: play.golang.com
- suffix: null
permissions:
- self-signed
host: hasura.io
```
https://github.com/hasura/graphql-engine-mono/pull/2343
GitOrigin-RevId: ef508ae946dc5c7c5bcb4a9a3ccb982394ae8639
2021-09-22 11:11:21 +03:00
- cli: add support for `network` metadata object
2021-09-23 09:49:32 +03:00
- cli: `hasura migrate apply --all-databases` will return a non zero exit code if operation failed on atleast one database (#7499)
2021-09-22 14:47:37 +03:00
- cli: `migrate create --from-server` creates the migration and marks it as applied on the server
2021-09-28 20:04:45 +03:00
- cli: support `query_tags` in metadata
2021-09-29 09:14:15 +03:00
- cli: add `hasura deploy` command
2021-09-29 14:11:24 +03:00
- cli: allow exporting and applying metadata from `yaml/json` files
2021-10-22 17:49:15 +03:00
- cli: allow squashing specific set of migrations. A new `--to` flag is introduced in `migrate squash` command. eg: `hasura migrate squash --from <v1> --to <v4>`
2021-10-07 17:23:19 +03:00
- cli: `hasura init --endpoint <endpoint>` adds an option to export metadata and create initial migration from the server.
2021-09-14 15:02:13 +03:00
2021-09-07 10:48:58 +03:00
## v2.0.9
2021-09-16 18:07:43 +03:00
- server: fix export_metadata V2 bug which included cron triggers with `include_in_metadata: false`
server: disable mutation for materialised views
The materialized views cannot be mutated, so this commit removes the option to run mutation on the materialized views via graphql endpoint. Before this, users could have tried running mutation for the materialized views using the graphql endpoint (or from HGE console), which would have resulted in the following error:
``` JSON
{
"errors": [
{
"extensions": {
"internal": {
"statement": "WITH \"articles_mat_view__mutation_result_alias\" AS (DELETE FROM \"public\".\"articles_mat_view\" WHERE (('true') AND (((((\"public\".\"articles_mat_view\".\"id\") = (('20155721-961c-4d8b-a5c4-873ed62c7a61')::uuid)) AND ('true')) AND ('true')) AND ('true'))) RETURNING * ), \"articles_mat_view__all_columns_alias\" AS (SELECT \"id\" , \"author_id\" , \"content\" , \"test_col\" , \"test_col2\" FROM \"articles_mat_view__mutation_result_alias\" ) SELECT json_build_object('affected_rows', (SELECT COUNT(*) FROM \"articles_mat_view__all_columns_alias\" ) ) ",
"prepared": false,
"error": {
"exec_status": "FatalError",
"hint": null,
"message": "cannot change materialized view \"articles_mat_view\"",
"status_code": "42809",
"description": null
},
"arguments": []
},
"path": "$",
"code": "unexpected"
},
"message": "database query error"
}
]
}
```
So, we don't want to generate the mutation fields for the materialized views altogether.
https://github.com/hasura/graphql-engine-mono/pull/2226
GitOrigin-RevId: 4ef441764035a8039e1c780d454569ee1f2febc3
2021-09-06 13:09:37 +03:00
- server: disable mutation for materialised views (#6688)
2021-09-01 20:56:46 +03:00
- server: set `tracecontext` and `userInfo` for DML actions on Postgres sources
2021-09-06 19:59:18 +03:00
- server: add support for `connection_parameters` on `pg_add_source` API
2021-08-31 12:56:31 +03:00
- cli: add progress bar for `migrate apply` command (#4795)
2021-09-07 08:59:57 +03:00
- cli: embed cli-ext for windows binaries (#7509)
2021-08-31 12:56:31 +03:00
2021-08-30 15:42:50 +03:00
## v2.0.8
server: fix the nullability of object relationships (fix hasura/graphql-engine#7201)
When adding object relationships, we set the nullability of the generated GraphQL field based on whether the database backend enforces that the referenced data always exists. For manual relationships (corresponding to `manual_configuration`), the database backend is unaware of any relationship between data, and hence such fields are always set to be nullable.
For relationships generated from foreign key constraints (corresponding to `foreign_key_constraint_on`), we distinguish between two cases:
1. The "forward" object relationship from a referencing table (i.e. which has the foreign key constraint) to a referenced table. This should be set to be non-nullable when all referencing columns are non-nullable. But in fact, it used to set it to be non-nullable if *any* referencing column is non-nullable, which is only correct in Postgres when `MATCH FULL` is set (a flag we don't consider). This fixes that by changing a boolean conjunction to a disjunction.
2. The "reverse" object relationship from a referenced table to a referencing table which has the foreign key constraint. This should always be set to be nullable. But in fact, it used to always be set to non-nullable, as was reported in hasura/graphql-engine#7201. This fixes that.
Moreover, we have moved the computation of the nullability from `Hasura.RQL.DDL.Relationship` to `Hasura.GraphQL.Schema.Select`: this nullability used to be passed through the `riIsNullable` field of `RelInfo`, but for array relationships this information is not actually used, and moreover the remaining fields of `RelInfo` are already enough to deduce the nullability.
This also adds regression tests for both (1) and (2) above.
https://github.com/hasura/graphql-engine-mono/pull/2159
GitOrigin-RevId: 617f12765614f49746d18d3368f41dfae2f3e6ca
2021-08-26 18:26:43 +03:00
- server: fix nullability of object relationships (close #7201 )
2021-08-25 10:30:57 +03:00
- server: update non-existent event trigger, action and query collection error msgs (close #7396 )
2021-08-19 13:27:54 +03:00
- server: fix broken `untrack_function` for non-default source
2021-08-24 10:36:32 +03:00
- server: Adding support for TLS allowlist by domain and service id (port)
2021-08-24 19:25:12 +03:00
- server: add support for `graphql-ws` clients
2021-08-27 12:57:21 +03:00
- console: fix error due to rendering inconsistent object's message
2021-08-26 17:07:08 +03:00
- console: support insecure TLS allowlist
2021-08-27 12:57:21 +03:00
- console: support computed fields in remote schema join
2021-08-30 13:49:37 +03:00
- console: fix data sidebar not updated when a table is renamed
2021-09-13 21:00:53 +03:00
- cli: fix delay starting console using `hasura console` (#7255)
2021-08-17 10:01:14 +03:00
2021-08-17 16:06:45 +03:00
## v2.0.7
2021-08-17 10:01:14 +03:00
- server: fix v2 -> v1 downgrade bug when cron triggers exist
2021-08-17 08:44:22 +03:00
- server: add index on the `event_id` column of the `hdb_cron_event_invocation_logs` table
2021-08-12 15:17:02 +03:00
- server: fix GraphQL type for remote relationship field (close #7284 )
2021-08-12 04:53:13 +03:00
- server: support EdDSA algorithm and key type for JWT
2021-08-11 15:41:34 +03:00
- server: fix GraphQL type for single-row returning functions (close #7109 )
2021-08-11 21:02:05 +03:00
- console: add support for creation of indexes for Postgres data sources
2021-08-18 19:15:43 +03:00
- docs: document the cleanup process for scheduled triggers
2021-08-16 12:22:20 +03:00
- console: allow same named queries and unnamed queries on allowlist file upload
2021-08-16 15:26:40 +03:00
- console: support computed fields in permission builder
2021-08-17 14:58:24 +03:00
- console: add custom timeouts to actions
2021-08-17 08:44:22 +03:00
2021-08-11 04:18:28 +03:00
## v2.0.6
2021-08-09 13:20:04 +03:00
- server: Add support for inherited roles for mutations, remote schema, actions and custom function permissions
2021-08-06 16:39:00 +03:00
- server: fix an issue with remote relationships when join columns are aliased (close #7180 )
2021-08-05 17:57:43 +03:00
- server: fix for incorrect `__typename` value in nested remote joins with a customized remote schema
Update GraphQL Parser version to fix text encoding issue (fix #1965)
### A long tale about encoding
GraphQL has an [introspection system](http://spec.graphql.org/June2018/#sec-Introspection), which allows its schema to be introspected. This is what we use to introspect [remote schemas](https://github.com/hasura/graphql-engine-mono/blob/41383e1f88c709c6cae4059a1b4fb8f2a58259e6/server/src-rsr/introspection.json). There is one place in the introspection where we might find GraphQL values: the default value of an argument.
```json
{
"fields": [
{
"name": "echo",
"args": [
{
"name": "msg",
"defaultValue": "\"Hello\\nWorld!\""
}
]
}
]
}
```
Note that GraphQL's introspection is transport agnostic: the default value isn't returned as a JSON value, but as a _string-encoded GraphQL Value_. In this case, the value is the GraphQL String `"Hello\nWorld!"`. Embedded into a string, it is encoded as: `"\"Hello\\nWorld!\""`.
When we [parse that value](https://github.com/hasura/graphql-engine-mono/blob/41383e1f88c709c6cae4059a1b4fb8f2a58259e6/server/src-lib/Hasura/GraphQL/RemoteServer.hs#L351), we first extract that JSON string, to get its content, `"Hello\nWorld!"`, then use our [GraphQL Parser library](https://github.com/hasura/graphql-parser-hs/blob/21c1ddfb41791578b66633a2e51f9deb43761108/src/Language/GraphQL/Draft/Parser.hs#L200) to interpret this: we find the double quote, understand that the content is a String, unescape the backslashes, and end up with the desired string value: `['H', 'e', 'l', 'l', 'o', '\n', 'W', 'o', 'r', 'l', 'd', '!']`. This all works fine.
However, there was a bug in the _printer_ part of our parser library: when printing back a String value, we would not re-escape characters properly. In practice, this meant that the GraphQL String `"Hello\nWorld"` would be encoded in JSON as `"\"Hello\nWorld!\""`. Note how the `\n` is not properly double-escaped. This led to a variety of problems, as described in #1965:
- we would successfully parse a remote schema containing such characters in its default values, but then would print those erroneous JSON values in our introspection, which would _crash the console_
- we would inject those default values in queries sent to remote schemas, and print them wrong doing so, sending invalid values to remote schemas and getting errors in result
It turns out that this bug had been lurking in the code for a long time: I combed through the history of [the parser library](https://github.com/hasura/graphql-parser-hs), and as far as I can tell, this bug has always been there. So why was it never caught? After all, we do have [round trip tests](https://github.com/hasura/graphql-parser-hs/blob/21c1ddfb41791578b66633a2e51f9deb43761108/test/Spec.hs#L52) that print + parse arbitrary values and check that we get the same value as a result. They do use any arbitrary unicode character in their generated strings. So... that should have covered it, right?
Well... it turns out that [the tests were ignoring errors](https://github.com/hasura/graphql-parser-hs/blob/7678066c49b61acf0c102a0ffe48e86897e2e22d/test/Spec.hs#L45), and would always return "SUCCESS" in CI, even if they failed... Furthermore, the sample size was small enough that, most of the time, _they would not hit such characters_. Running the tests locally on a loop, I only got errors ~10% of the time...
This was all fixed in hasura/graphql-parser-hs#44. This was probably one of Hasura's longest standing bugs? ^^'
### Description
This PR bumps the version of graphql-parser-hs in the engine, and switches some of our own arbitrary tests to use unicode characters in text rather than alphanumeric values. It turns out those tests were much better at hitting "bad" values, and that they consistently failed when generating arbitrary unicode characters.
https://github.com/hasura/graphql-engine-mono/pull/2031
GitOrigin-RevId: 54fa48270386a67336e5544351691619e0684559
2021-08-06 14:53:52 +03:00
- server: fix a bug where some unicode characters in default string values for fields in remote schemas could lead to internal errors
2021-08-06 22:57:37 +03:00
- server: bigquery: implement `_in` and `_nin` operators. (close #7343 )
2021-08-18 16:00:05 +03:00
- server: bigquery: custom root names, table names and field names for bigquery are included in tests
2021-08-06 08:00:12 +03:00
- console: fix untracked foreign-key relationships suggestion across schemas
2021-08-11 17:20:21 +03:00
- console: allow resolution of conflicting inherited role permissions
2021-08-06 08:00:12 +03:00
- cli: fix SDL formatting in `actions.graphql` (#7296)
2021-08-05 17:57:43 +03:00
2021-08-05 10:34:19 +03:00
## v2.0.5
2021-08-05 00:23:33 +03:00
- server: prevent invalid collisions in remote variable cache key (close #7170 )
2021-08-04 17:51:20 +03:00
- server: preserve unchanged cron triggers in `replace_metadata` API
2021-08-03 14:11:01 +03:00
- server: fix inherited roles bug where mutations were not accessible when inherited roles was enabled
2021-08-03 12:22:29 +03:00
- server: reintroduce the unique name constraint in allowed lists
2021-07-31 00:41:52 +03:00
- server: subscriptions now validate that all session variables are properly set (#7111)
2021-08-06 12:08:27 +03:00
- console: fix metadata out-of-date errors when creating tables with certain configurations (fix #6805 ) (fix #7233 )
2021-08-04 09:09:35 +03:00
- cli-migrations-v2: fix database url showing up in metadata (#7319)
2021-06-16 14:56:35 +03:00
2021-07-29 15:02:55 +03:00
## v2.0.4
2021-07-28 11:09:32 +03:00
- server: Support computed fields in permission check/filter (close #7102 )
2021-07-27 19:27:28 +03:00
- server: support computed fields in query 'order_by' (close #7103 )
2021-07-31 00:41:52 +03:00
- server: log warning if there are errors while executing clean up actions after "drop source" (previously it would throw an error)
2021-07-23 15:25:16 +03:00
- server: Fixed a bug where MSSQL and BigQuery would ignore environment variables set from the console
2021-07-21 08:02:44 +03:00
- server: Fixing bug in ReplaceMetadata parser - Moving from Alternative to committed-choice.
2021-07-21 15:04:58 +03:00
- server: Relax the unique operation name constraint when adding a query to a query collection
server: remove remnants of query plan caching (fix #1795)
Query plan caching was introduced by - I believe - hasura/graphql-engine#1934 in order to reduce the query response latency. During the development of PDV in hasura/graphql-engine#4111, it was found out that the new architecture (for which query plan caching wasn't implemented) performed comparably to the pre-PDV architecture with caching. Hence, it was decided to leave query plan caching until some day in the future when it was deemed necessary.
Well, we're in the future now, and there still isn't a convincing argument for query plan caching. So the time has come to remove some references to query plan caching from the codebase. For the most part, any code being removed would probably not be very well suited to the post-PDV architecture of query execution, so arguably not much is lost.
Apart from simplifying the code, this PR will contribute towards making the GraphQL schema generation more modular, testable, and easier to profile. I'd like to eventually work towards a situation in which it's easy to generate a GraphQL schema parser *in isolation*, without being connected to a database, and then parse a GraphQL query *in isolation*, without even listening any HTTP port. It is important that both of these operations can be examined in detail, and in isolation, since they are two major performance bottlenecks, as well as phases where many important upcoming features hook into.
Implementation
The following have been removed:
- The entirety of `server/src-lib/Hasura/GraphQL/Execute/Plan.hs`
- The core phases of query parsing and execution no longer have any references to query plan caching. Note that this is not to be confused with query *response* caching, which is not affected by this PR. This includes removal of the types:
- - `Opaque`, which is replaced by a tuple. Note that the old implementation was broken and did not adequately hide the constructors.
- - `QueryReusability` (and the `markNotReusable` method). Notably, the implementation of the `ParseT` monad now consists of two, rather than three, monad transformers.
- Cache-related tests (in `server/src-test/Hasura/CacheBoundedSpec.hs`) have been removed .
- References to query plan caching in the documentation.
- The `planCacheOptions` in the `TenantConfig` type class was removed. However, during parsing, unrecognized fields in the YAML config get ignored, so this does not cause a breaking change. (Confirmed manually, as well as in consultation with @sordina.)
- The metrics no longer send cache hit/miss messages.
There are a few places in which one can still find references to query plan caching:
- We still accept the `--query-plan-cache-size` command-line option for backwards compatibility. The `HASURA_QUERY_PLAN_CACHE_SIZE` environment variable is not read.
https://github.com/hasura/graphql-engine-mono/pull/1815
GitOrigin-RevId: 17d92b254ec093c62a7dfeec478658ede0813eb7
2021-07-27 14:51:52 +03:00
- server: officially deprecate query plan caching, which had already been disabled for a long time
2021-07-22 17:59:23 +03:00
- server/bigquery: Fix issues related to adding and querying from non-US datasets (closes [6937 ](https://github.com/hasura/graphql-engine/issues/6937 )).
2021-08-05 10:34:19 +03:00
- console: add template gallery
2021-07-22 12:57:30 +03:00
- console: add pagination on the Raw SQL results page
2021-07-23 19:35:05 +03:00
- console: fix issues with replacing invalid graphql identifiers in table and column names
2021-07-27 09:55:59 +03:00
- console: show error message on inconsistent objects table
2021-07-30 12:02:38 +03:00
- server/mssql: Fix [graphql-engine#7130 ](https://github.com/hasura/graphql-engine/issues/7130 ) for `__typename` errors and more
generally, JSON-style aggregates.
2021-07-29 10:21:25 +03:00
- cli: add support for `query_tags` metadata object
2021-07-21 08:02:44 +03:00
2021-07-19 17:23:56 +03:00
## v2.0.3
(Add entries below in the order of server, console, cli, docs, others)
2021-07-17 00:18:58 +03:00
- server: inherited role improvements for select queries
- an inherited role can now inherit from other inherited roles as well
- explicit permissions for inherited roles can now be set which will override the inherited permission (if any)
2021-07-19 14:39:22 +03:00
- server: fix optional global_select_limit config for BigQuery
2021-07-16 18:04:30 +03:00
- console: support `global_select_limit` for bigquery sources
2021-07-16 08:26:00 +03:00
- cli: add `-o` /`--output` flag for `hasura metadata inconsistency list` command
2021-07-15 10:30:10 +03:00
## v2.0.2
2021-07-13 15:23:30 +03:00
- server: only if `query-log` is enabled the graphql query string is printed in `http-log` and `websocket-log`
2021-07-13 10:56:32 +03:00
- server: fix reloading inconsistent sources or remote schemas via `reload_metadata` API
2021-07-12 19:03:36 +03:00
- server: support scalar computed fields in remote joins (close #7101 )
2021-07-07 14:58:37 +03:00
- server: Support computed fields in query filter (`where` argument) (close #7100 )
2021-07-05 12:45:31 +03:00
- server: add a `$.detail.operation.request_mode` field to `http-log` which takes the values `"single"` or `"batched"` to log whether a GraphQL request was executed on its own or as part of a batch
2021-07-02 16:05:04 +03:00
- server: add `query` field to `http-log` and `websocket-log` in non-error cases
2021-09-17 10:43:43 +03:00
- server: Add global limit to BigQuery via the `global_select_limit` field in the connection configuration
2021-07-05 10:47:45 +03:00
- server: include action and event names in log output
2021-07-07 13:14:13 +03:00
- server: log all HTTP errors in remote schema calls as `remote-schema-error` with details
2021-07-13 18:49:19 +03:00
- server: For BigQuery, make `global_select_limit` configuration optional with a default value of
`1000`
2021-07-14 09:15:14 +03:00
- console: add `reload all databases` checkbox to the metadata settings page
- console: add schema sharing
2021-07-14 12:45:49 +03:00
- console: fix issue with changing table's column name and graphQL field name simultaneously
2021-07-20 15:39:09 +03:00
- console: fix adding/removing/updating database not getting added to `metadata/databases.yaml` in CLI mode
- console: fix migrations being generated for allowed queries and inherited roles and in CLI mode
2021-07-14 11:53:54 +03:00
- cli: add linux and darwin arm64 support
2021-07-13 19:55:59 +03:00
2021-06-23 21:09:15 +03:00
## v2.0.1
- server: fix resetting metadata catalog version to 43 while initializing postgres source with v1.0 catalog
2021-06-23 11:34:10 +03:00
## v2.0.0
NOTE: This only includes the diff between v2.0.0 and v2.0.0-beta.2
2021-06-16 16:27:26 +03:00
- server: make improvements in the `livequery-poller-log`
2021-06-17 16:21:55 +03:00
- server: Backends Citus, MSSQL, and BigQuery now all support the `set_table_customization` operation.
2021-06-17 22:16:11 +03:00
- server: Adds caching support for queries using remote schema permissions
2021-06-18 18:34:05 +03:00
- server: All Postgres boolean operators now support the null-collapsing behaviour described in [#704 ](https://github.com/hasura/graphql-engine/issues/704 ) and enabled via the `HASURA_GRAPHQL_V1_BOOLEAN_NULL_COLLAPSE` environment variable.
2021-06-21 20:41:43 +03:00
- server: add `update_remote_schema` metadata query
2021-06-21 09:46:29 +03:00
- console: add citus support
2021-06-21 20:41:43 +03:00
- console: add support for `update_remote_schema` API while modifying remote schemas
2021-06-22 18:23:11 +03:00
- console: hide postgres system schemas by default
2021-06-21 17:34:10 +03:00
- cli: `metadata diff` will now only show the differences in metadata. old behaviour is avialble behind a flag (`--type unified-common`) (#5487)
2021-06-21 20:41:43 +03:00
- cli: add citus support
2021-06-21 18:56:50 +03:00
- cli: allow `--skip-execution` to be used with `up` and `down` flags in `migrate apply`
2021-06-22 14:15:22 +03:00
- cli: allow deleting migration state from server using `--server` flag in `migrate delete` command
2021-06-16 16:27:26 +03:00
2021-06-16 14:56:35 +03:00
## v2.0.0-beta.2
### Bug fixes and improvements
2021-04-22 13:26:42 +03:00
2021-07-08 23:49:10 +03:00
- server: nodes aggregates and inherited roles support for SQL Server
2021-06-11 06:26:50 +03:00
- server: remote relationships (database to remote schema joins) are now supported on SQL Server and BigQuery
2021-06-15 11:58:21 +03:00
- server: BigQuery: switches to a single query generation from a dataloader approach. This should result in
faster query responses.
- server: BigQuery: various bug fixes related to aggregations
2021-06-09 15:12:25 +03:00
- server: fix add source API wiping out source's metadata when replace_configuration is true
2021-07-30 14:33:06 +03:00
- server: add support for customization of field names and type names when adding a remote schema
2021-06-03 14:48:25 +03:00
- console: add foreign key CRUD functionality to ms sql server tables
2021-06-08 18:21:29 +03:00
- console: allow tracking of custom SQL functions having composite type (rowtype) input arguments
2021-06-09 11:51:23 +03:00
- console: allow input object presets in remote schema permissions
2021-06-10 12:08:32 +03:00
- console: add modify functionality on columns, primary keys & unique keys to MS SQL Server tables
2021-06-09 10:12:56 +03:00
- cli: add interactive prompt to get input when `--database-name` flag is missing
2021-06-09 13:45:13 +03:00
- cli: fix metadata export to avoid unnecessary empty lines in actions.graphql (#5338)
2021-06-15 09:29:45 +03:00
- cli: generate migrations for mssql databases in hasura console mode (#7011)
2021-06-02 15:07:09 +03:00
## v2.0.0-beta.1
### Bug fixes and improvements
- server: fix regression with MSSQL execution (#6976)
2021-06-01 20:33:25 +03:00
- server: fix asymptotic performance of fetching from the event_log table
2021-05-25 16:02:15 +03:00
- console: add `pool_timeout` , `connection_lifetime` and `isolation_level` connection params to connect database form
2021-05-26 17:26:53 +03:00
- console: add check constraints and comments to MS SQL Server tables' read-only modify page
2021-06-09 15:12:25 +03:00
- console: add create table functionality for MS SQL Server
2021-05-27 18:59:02 +03:00
- console: update connect database form with SSL certificates
2021-05-28 00:25:55 +03:00
- console: add drop table functionality to MS SQL Server tables
2021-05-28 10:58:46 +03:00
- console: allow renaming data sources
2021-06-02 13:23:00 +03:00
- console: show error notification for table and cloumn names exceeding 63 characters and trim migration names exceeding 255 characters
2021-05-31 07:12:31 +03:00
- cli: fix version command using stderr as output stream (#6998)
2021-05-25 16:02:15 +03:00
2021-05-25 15:17:41 +03:00
## v2.0.0-alpha.11
2021-05-20 09:28:35 +03:00
### Breaking Changes
- In this release, the name of the computed field argument has changed from `<function_name>_args` to
`<computed_field_name>_<table_name>_args` as the function name is internal detail for a computed field.
This change also enables adding a root-level tracked function as a computed field which previously would have thrown input type conflict error.
### Bug fixes and improvements
2021-05-27 18:06:13 +03:00
- server: detect and apply metadata changes by `mssql_run_sql` API if required
2021-05-26 19:19:26 +03:00
- server: fix bug with creation of new cron events when cron trigger is imported via metadata
2021-05-25 13:49:59 +03:00
- server: log warning for deprecated environment variables.
2021-05-25 09:50:13 +03:00
- server: initialise `hdb_catalog` tables only when required, and only run the event loop for sources where it is required
2021-05-24 23:12:53 +03:00
- server: fix a bug where remote schema permissions would fail when used in conjunction with query variables (fix #6656 )
2021-05-24 16:13:08 +03:00
- server: add `rename_source` metadata API (fix #6681 )
2021-05-24 10:33:33 +03:00
- server: fix subscriptions with session argument in user-defined function (fix #6657 )
2021-05-21 15:27:44 +03:00
- server: MSSQL: Support ORDER BY for text/ntext types.
- server: MSSQL: Support _lt, _eq, etc. for text/ntext types.
- server: MSSQL: Fix offset when there's no order by.
- server: MSSQL: Support booleans better.
2021-05-24 12:08:52 +03:00
- server: Include permission filter in the exists clause (fix #6931 )
2021-05-21 05:46:58 +03:00
- server: add support for adding multi-column foreign key relationships
2021-05-20 13:03:02 +03:00
- server: fix a bug where `@skip` and `@include` were not allowed on the same field
- server: properly reject queries containing unknown or misplaced directives
2021-05-20 10:23:21 +03:00
- server: fix bigint overflow, incorrect geojson format in event trigger payload (fix #3697 ) (fix #2368 )
2021-05-19 19:37:47 +03:00
- server: fix introspection output not being consistently ordered
2021-05-19 17:07:04 +03:00
- server: forward the x-request-id header when generated by graphql-engine (instead of being user-provided) (fix #6654 )
2021-05-18 11:47:55 +03:00
- server: fix erroneous schema type for action output fields (fix #6631 )
- server: introduce `--graceful-shutdown-timeout` server config which will wait for the in-flight scheduled and event trigger events and async actions to complete before shutting down
2021-05-13 23:12:52 +03:00
- server: fix a regression from V1 and allow string values for most Postgres column types
server: sanitise event trigger logs (fix #1233)
- sanitise the response field in event trigger and scheduled trigger logs, removing the body and the headers
- flatten the log structure to include the event id at `$.detail.event_id` instead of `$.detail.context.event_id`
the log format changes as follows:
```diff
diff --git a/log b/log
index 96127e0..1fb909a 100644
--- a/log
+++ b/log
@@ -1,48 +1,15 @@
{
"detail": {
- "context": {
- "event_id": "b9d4e627-6029-43f2-9d46-31c532b07070"
- },
+ "event_id": "adcc8dcd-2f32-4554-bd55-90c787aee137",
"request": {
"size": 416
},
"response": {
- "body": "{\n \"args\": {}, \n \"data\": \"{\\\"event\\\":{\\\"session_variables\\\":{\\\"x-hasura-role\\\":\\\"admin\\\"},\\\"op\\\":\\\"INSERT\\\",\\\"data\\\":{\\\"old\\\":null,\\\"new\\\":{\\\"name\\\":\\\"someotheranimal\\\",\\\"id\\\":3}},\\\"trace_context\\\":{\\\"trace_id\\\":\\\"e8237c03de151634\\\",\\\"span_id\\\":\\\"8c5f8952e9e06da8\\\"}},\\\"created_at\\\":\\\"2021-05-06T07:52:58.796611Z\\\",\\\"id>
- "headers": [
- {
- "name": "Date",
- "value": "Thu, 06 May 2021 07:53:00 GMT"
- },
- {
- "name": "Content-Type",
- "value": "application/json"
- },
- {
- "name": "Content-Length",
- "value": "1692"
- },
- {
- "name": "Connection",
- "value": "keep-alive"
- },
- {
- "name": "Server",
- "value": "gunicorn/19.9.0"
- },
- {
- "name": "Access-Control-Allow-Origin",
- "value": "*"
- },
- {
- "name": "Access-Control-Allow-Credentials",
- "value": "true"
- }
- ],
- "size": 1692,
+ "size": 1719,
"status": 200
}
},
"level": "info",
- "timestamp": "2021-05-06T13:23:00.376+0530",
+ "timestamp": "2021-05-06T13:25:14.481+0530",
"type": "event-trigger"
}
```
GitOrigin-RevId: d9622de366737da04dc6d9ff73238be16ec9305e
2021-05-12 15:09:51 +03:00
- server: sanitise event trigger and scheduled trigger logs to omit possibly sensitive request body and headers
2021-05-12 02:27:35 +03:00
- server: fix parsing of values for Postgres char columns (fix #6814 )
2021-05-06 12:18:57 +03:00
- server: fix query execution of custom function containing a composite argument type
2021-05-04 20:57:47 +03:00
- server: fix a bug in query validation that would cause some queries using default variable values to be rejected (fix #6867 )
2021-05-11 13:04:38 +03:00
- server: REST endpoint bugfix for UUID url params
2021-05-06 03:52:14 +03:00
- server: custom URI schemes are now supported in CORS config (fix #5818 ) (#5940)
2021-05-11 13:04:38 +03:00
- server: explaining/analyzing a query now works for mssql sources
2021-05-10 13:17:54 +03:00
- server: fix MSSQL multiplexed subscriptions (fix #6887 )
2021-05-18 16:06:42 +03:00
- server: fix bug preventing tables with the same name in different sources
2021-05-19 08:01:54 +03:00
- server: include more detail in inconsistent metadata error messages (fix #6684 )
2021-05-28 07:31:41 +03:00
- server: return useful error messages for missing env vars in metadata when `allow_inconsistent_metadata` is enabled (fix #6913 )
2021-05-12 19:15:57 +03:00
- console: add union types to remote schema permissions
2021-05-04 17:40:56 +03:00
- console: read-only modify page for mssql
2021-05-04 14:19:40 +03:00
- console: filter out partitions from track table list and display partition info
2021-05-04 15:40:50 +03:00
- console: fixes an issue where no schemas are listed on an MSSQL source
2021-05-19 15:41:54 +03:00
- console: allow editing sources configuration
- console: show db version and source details in manage db page
- console: add one-to-one relationships support
2021-05-24 18:09:05 +03:00
- console: rearrange connect database form and add prepared statements
2021-05-24 05:33:45 +03:00
- cli: add `-o` /`--output` flag for `hasura metadata` `apply` & `export` subcommands
2021-05-14 22:09:01 +03:00
```
# export metadata and write to stdout
$ hasura metadata export -o json
```
2021-05-17 07:52:41 +03:00
- cli: add support for `graphql_schema_introspection` metadata object
2021-05-17 18:19:15 +03:00
- cli: fix applying migrations in a different environment after config v3 update (#6861)
2021-05-19 06:35:30 +03:00
- cli: fix bug caused by usage of space character in database name (#6852)
- cli: fix issues with generated filepaths in windows (#6813)
2021-05-20 12:13:39 +03:00
- cli: add warning for incompatible pro plugin version
2021-05-24 05:33:45 +03:00
- cli: add new sub command `delete` to `hasura migrate`
2021-05-24 09:04:53 +03:00
- cli: fix bug in migrate squash due to empty down file (#3897)
2021-05-27 17:16:31 +03:00
- cli: fix bug with metadata apply on some CI environments (#6987)
2021-04-29 14:16:56 +03:00
## v2.0.0-alpha.10
2021-04-22 13:26:42 +03:00
### Bug fixes and improvements
2021-05-03 15:07:06 +03:00
- server: fix MSSQL table metadata SQL, return empty array for empty rows (fix #1226 )
2021-04-28 14:05:33 +03:00
- server: aggregation fields are now supported on mssql
2021-04-27 20:22:54 +03:00
- server: accept a new server config flag `--events-fetch-batch-size` to configure the number of rows being fetched from the events log table in a single batch
2021-05-03 15:07:06 +03:00
- server: restore proper batching behavior in event trigger processing so that at most 2x batch events are checked out at a time
2021-04-22 13:26:42 +03:00
- server: fix regression: `on_conflict` was missing in the schema for inserts in tables where the current user has no columns listed in their update permissions (fix #6804 )
2021-04-29 14:16:56 +03:00
- server: fix one-to-one relationship bug which prevented adding one-to-one relationships which didn't have the same column name for target and source
2021-04-23 18:01:35 +03:00
- console: fix Postgres table creation when table has a non-lowercase name and a comment (#6760)
2021-04-21 13:09:09 +03:00
- cli: fix regression - `metadata apply —dry-run` was overwriting local metadata files with metadata on server when it should just display the differences.
2021-04-27 08:34:14 +03:00
- server: decrease polling interval for scheduled triggers from 60 to 10 seconds
2021-04-29 01:26:32 +03:00
- server: Change `HASURA_GRAPHQL_SCHEMA_POLL_INTERVAL` env var to `HASURA_GRAPHQL_SCHEMA_SYNC_POLL_INTERVAL` and `schema-poll-interval` option to `--schema-sync-poll-interval` .
2021-04-21 13:09:09 +03:00
2021-04-21 10:33:50 +03:00
## v2.0.0-alpha.9
2021-04-16 16:38:13 +03:00
2021-04-19 15:16:10 +03:00
### Support comparing columns across related tables in permission's boolean expressions
We now support comparing columns across related tables. For example:
Consider two tables, `items(id, name, quantity)` and `shopping_cart(id, item_id, quantity)`
and these two tables are related via the `item_id` column. Now, while defining insert permission
on the `shopping_cart` table, there can be a check to insert an item into the shopping cart
only when there are enough present in the items inventory.
### Bug fixes and improvements
2021-04-28 19:49:23 +03:00
- server: make the ``HASURA_GRAPHQL_PG_CONN_LIFETIME``, ``HASURA_GRAPHQL_POOL_TIMEOUT`` and ``HASURA_GRAPHQL_TX_ISOLATION`` configs source specific
2021-04-21 10:33:50 +03:00
- server: fix bug with catalog upgrade from alpha.7 (fix #6802 )
2021-04-21 04:16:08 +03:00
- server: fix a bug in remote schema permissions that could result in an invalid GraphQL schema (fix #6029 , #6703 )
2021-04-20 19:57:14 +03:00
- server: support query multiplexing in MSSQL subscriptions
2021-04-21 12:12:21 +03:00
- server: an inherited role's limit will be the max limit of all the roles (#6671)
2021-04-16 20:21:10 +03:00
- console: add bigquery support (#1000)
2021-04-19 10:05:21 +03:00
- cli: add support for bigquery in metadata operations
2021-04-08 11:25:11 +03:00
2021-04-16 16:38:13 +03:00
## v2.0.0-alpha.8
2021-04-16 16:26:11 +03:00
2021-04-14 16:02:16 +03:00
### Support for 3D PostGIS Operators
We now support the use of the functions `ST_3DDWithin` and `ST_3DIntersects` in boolean expressions.
Note that `ST_3DIntersects` requires PostGIS be [built with SFCGAL support ](https://www.postgis.net/docs/manual-3.1/reference.html#reference_sfcgal ) which may depend on the PostGIS distribution used.
2021-04-08 11:25:11 +03:00
### Support for null values in boolean expressions
In v2, we introduced a breaking change, that aimed at fixing a [long-standing issue ](https://github.com/hasura/graphql-engine/issues/704 ): a null value in a boolean expression would always evaluate to `True` for all rows. For example, the following queries were all equivalent:
```graphql
delete_users(where: {_id: {_eq: null}}) # field is null, which is as if it were omitted
delete_users(where: {_id: {}}) # object is empty, evaluates to True for all rows
delete_users(where: {}) # object is empty, evaluates to True for all rows
delete_users() # delete all users
```
This behaviour was unintuitive, and could be an unpleasant surprise for users that expected the first query to mean "delete all users for whom the id column is null". Therefore in v2, we changed the implementation of boolean operators to reject null values, as we deemed it safer:
```graphql
delete_users(where: {_id: {_eq: null}}) # error: argument of _eq cannot be null
```
However, this change broke the workflows of [some of our users ](https://github.com/hasura/graphql-engine/issues/6660 ) who were relying on this property of boolean operators. This was used, for instance, to _conditionally_ enable a test:
```graphql
query($isVerified: Boolean) {
users(where: {_isVerified: {_eq: $isVerified}}) {
name
}
}
```
In the future, we will probably offer a way to explicitly choose which behaviour to use for each `where` clause; perhaps by introducing new and distinct operators that make it explicit that they will default to true if the value is null. In the meantime, this release provides a way to revert the engine to its previous behaviour: if the `HASURA_GRAPHQL_V1_BOOLEAN_NULL_COLLAPSE` environment variable is set to "true", null values in boolean expression will behave like they did in v1 for the following operators: `_is_null` , `_eq` , `_neq` , `_in` , `_nin` , `_gt` , `_lt` , `_gte` , `_lte` .
### Bug fixes and improvements
2021-04-16 16:38:13 +03:00
- server: all /query APIs now require admin privileges
2021-04-13 20:32:29 +03:00
- server: add a new `/dev/rts_stats` endpoint, enabled when hasura is started with '+RTS -T'
2021-04-13 05:55:06 +03:00
- server: re-enable a default HASURA_GRAPHQL_PG_CONN_LIFETIME of 10min
2021-04-12 13:18:29 +03:00
- server: support for bigquery datasets
2021-04-14 13:39:53 +03:00
- server: format the values of `injectEventContext` as hexadecimal string instead of integer (fix #6465 )
2021-04-28 20:38:05 +03:00
- server: add "kind" field to query-log items. Kind can be "database", "action", "remote-schema", "cached" or "introspection".
2021-04-07 12:11:47 +03:00
- console: add custom_column_names to track_table request with replaced invalid characters (#992)
2021-04-08 23:39:57 +03:00
- console: add details button to the success notification to see inserted row
2021-04-13 19:20:57 +03:00
- console: add request preview for REST endpoints
2021-04-16 14:50:54 +03:00
- cli: fix errors being ignored during `metadata apply` in config v3 (fix #6784 )
2021-04-07 12:11:47 +03:00
2021-04-06 14:05:46 +03:00
## v2.0.0-alpha.7
2021-04-01 23:40:31 +03:00
### Transactions for Postgres mutations
With v2 came the introduction of heterogeneous execution: in one query or mutation, you can target different sources: it is possible, for instance, in one mutation, to both insert a row in a table in a table on Postgres and another row in another table on MSSQL:
2021-04-08 11:25:11 +03:00
```graphql
2021-04-01 23:40:31 +03:00
mutation {
// goes to Postgres
insert_author_one(object: {name: "Simon Peyton Jones"}) {
name
}
// goes to MSSQL
insert_publication_one(object: {name: "Template meta-programming for Haskell"}) {
name
}
}
```
However, heterogeneous execution has a cost: we can no longer run mutations as a transaction, given that each part may target a different database. This is a regression compared to v1.
While we want to fix this by offering, in the future, an explicit API that allows our users to *choose* when a series of mutations are executed as a transaction, for now we are introducing the following optimisation: when all the fields in a mutation target the same Postgres source, we will run them as a transaction like we would have in v1.
### Bug fixes and improvements
2021-04-14 20:51:02 +03:00
- server: `use_prepared_statements` option (default: False) in `add_pg_source` metadata API
2021-03-31 13:39:01 +03:00
- server: add `--async-actions-fetch-interval` command-line flag and `HASURA_GRAPHQL_ASYNC_ACTIONS_FETCH_INTERVAL` environment variable for configuring
async actions re-fetch interval from metadata storage (fix #6460 )
2021-03-30 13:09:29 +03:00
- server: add 'replace_configuration' option (default: false) in the add source API payload
2021-03-24 23:10:45 +03:00
- server: add a comment field for actions (#231)
2021-03-26 19:59:16 +03:00
- server: accept GeoJSON for MSSQL geometry and geography operators (#787)
2021-03-31 17:48:36 +03:00
- server: update pg_dump clean output to disable function body validation in create function statements to avoid errors due to forward references
2021-03-31 16:48:36 +03:00
- server: fix a bug preventing some MSSQL foreign key relationships from being tracked
2021-03-24 23:10:45 +03:00
- console: add a comment field for actions (#231)
2021-04-05 18:39:53 +03:00
- console: data sidebar bug fixes and improvements (#921)
2021-04-01 13:38:55 +03:00
- cli: fix seeds incorrectly being applied to databases in config v3 (#6683)
2021-04-01 15:58:24 +03:00
- cli: add `--all-databases` flag for `migrate apply` , this allows applying migrations on all connected databases in one go
2021-04-06 12:58:24 +03:00
- cli-migrations: add config v3 image
2021-04-05 11:10:50 +03:00
- docs: add Hasura v2 upgrade guide (#1030)
2021-03-24 23:10:45 +03:00
2021-03-26 12:48:26 +03:00
## v2.0.0-alpha.6
2021-03-24 16:43:40 +03:00
### Support geometry and geography spatial data comparison operators in MS SQL Server
Comparison operators on spatial data types, geometry and geography, are now supported in MS SQL Server. The following operators are supported:
- STEquals
- STIntersects
- STTouches
- STOverlaps
- STCrosses
- STWithin
- STContains
**Example query:** Select values equal to a given geography instance
```
query {
spatial_types_geog(
where: {
point: { _st_equals: "POINT(3 4)" }
}
) {
point
}
}
```
**Example query:** Select values that spatially contain a given geometry instance
```
query {
spatial_types_geom(
where: {
compoundcurve: { _st_contains: "POINT(0.5 0)" }
}
) {
compoundcurve
}
}
```
2021-03-24 14:25:24 +03:00
2021-03-26 12:48:26 +03:00
### Bug fixes and improvements
2021-03-24 14:25:24 +03:00
2021-03-22 13:56:44 +03:00
- server: fix action output type schema generation (fix #6631 )
2021-03-18 21:32:47 +03:00
- server/mssql: `mssql_add_source` can now take connection strings from environment variables
2021-03-24 16:43:40 +03:00
- server: support `IN` , `NIN` , `LIKE` and `NLIKE` operators in MS SQL Server
2021-03-23 19:03:07 +03:00
- server: remove the restriction of supporting only base type function arguments. The type of an argument with a table type is now `<tablename>_scalar` to avoid conflicts with the object type `<tablename>` .
2021-03-18 18:28:25 +03:00
- server: fix inherited_roles issue when some of the underlying roles don't have permissions configured (fixes #6672 )
2021-03-19 17:46:50 +03:00
- server: fix action custom types failing to parse when mutually recursive
2021-03-22 23:06:34 +03:00
- server: fix MSSQL table name descriptions
2021-03-25 10:41:52 +03:00
- server: emit `postgres-max-connections-error` when max postgres connections are reached
2021-04-13 10:00:43 +03:00
- server: disable caching for actions when "forward-client-headers" option is turned on
2021-03-22 20:53:13 +03:00
- console: allow editing rest endpoints queries and misc ui improvements
2021-03-23 17:41:05 +03:00
- console: display collection names and queries from all collections in allowlist
2021-03-19 10:37:51 +03:00
- cli: match ordering of keys in project metadata files with server metadata
2021-03-18 09:29:23 +03:00
## v2.0.0-alpha.5
### Bug fixes and improvements
2021-03-15 09:30:53 +03:00
- server: fix issue with parsing of remote schema list of input objects (fix #6584 )
2021-03-18 15:49:57 +03:00
- server: support tracking functions having only base type arguments (fix #6628 )
2021-03-17 15:39:20 +03:00
- console: add browse rows for mssql tables (#805)
2021-03-17 18:56:31 +03:00
- console: remote schema permissions bug fixes (#439)
2021-03-18 09:10:58 +03:00
- cli: cli-ext is now a native part of cli binary (no longer needed as a plugin)
- cli: fix issue with adding operation to allow list in console mode (fix #6617 )
2021-03-10 14:47:45 +03:00
## v2.0.0-alpha.4
### Bug fixes and improvements
2021-03-05 13:52:40 +03:00
- server/mssql: support tracking and querying from views
[Preview] Inherited roles for postgres read queries
fixes #3868
docker image - `hasura/graphql-engine:inherited-roles-preview-48b73a2de`
Note:
To be able to use the inherited roles feature, the graphql-engine should be started with the env variable `HASURA_GRAPHQL_EXPERIMENTAL_FEATURES` set to `inherited_roles`.
Introduction
------------
This PR implements the idea of multiple roles as presented in this [paper](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/FGALanguageICDE07.pdf). The multiple roles feature in this PR can be used via inherited roles. An inherited role is a role which can be created by combining multiple singular roles. For example, if there are two roles `author` and `editor` configured in the graphql-engine, then we can create a inherited role with the name of `combined_author_editor` role which will combine the select permissions of the `author` and `editor` roles and then make GraphQL queries using the `combined_author_editor`.
How are select permissions of different roles are combined?
------------------------------------------------------------
A select permission includes 5 things:
1. Columns accessible to the role
2. Row selection filter
3. Limit
4. Allow aggregation
5. Scalar computed fields accessible to the role
Suppose there are two roles, `role1` gives access to the `address` column with row filter `P1` and `role2` gives access to both the `address` and the `phone` column with row filter `P2` and we create a new role `combined_roles` which combines `role1` and `role2`.
Let's say the following GraphQL query is queried with the `combined_roles` role.
```graphql
query {
employees {
address
phone
}
}
```
This will translate to the following SQL query:
```sql
select
(case when (P1 or P2) then address else null end) as address,
(case when P2 then phone else null end) as phone
from employee
where (P1 or P2)
```
The other parameters of the select permission will be combined in the following manner:
1. Limit - Minimum of the limits will be the limit of the inherited role
2. Allow aggregations - If any of the role allows aggregation, then the inherited role will allow aggregation
3. Scalar computed fields - same as table column fields, as in the above example
APIs for inherited roles:
----------------------
1. `add_inherited_role`
`add_inherited_role` is the [metadata API](https://hasura.io/docs/1.0/graphql/core/api-reference/index.html#schema-metadata-api) to create a new inherited role. It accepts two arguments
`role_name`: the name of the inherited role to be added (String)
`role_set`: list of roles that need to be combined (Array of Strings)
Example:
```json
{
"type": "add_inherited_role",
"args": {
"role_name":"combined_user",
"role_set":[
"user",
"user1"
]
}
}
```
After adding the inherited role, the inherited role can be used like single roles like earlier
Note:
An inherited role can only be created with non-inherited/singular roles.
2. `drop_inherited_role`
The `drop_inherited_role` API accepts the name of the inherited role and drops it from the metadata. It accepts a single argument:
`role_name`: name of the inherited role to be dropped
Example:
```json
{
"type": "drop_inherited_role",
"args": {
"role_name":"combined_user"
}
}
```
Metadata
---------
The derived roles metadata will be included under the `experimental_features` key while exporting the metadata.
```json
{
"experimental_features": {
"derived_roles": [
{
"role_name": "manager_is_employee_too",
"role_set": [
"employee",
"manager"
]
}
]
}
}
```
Scope
------
Only postgres queries and subscriptions are supported in this PR.
Important points:
-----------------
1. All columns exposed to an inherited role will be marked as `nullable`, this is done so that cell value nullification can be done.
TODOs
-------
- [ ] Tests
- [ ] Test a GraphQL query running with a inherited role without enabling inherited roles in experimental features
- [] Tests for aggregate queries, limit, computed fields, functions, subscriptions (?)
- [ ] Introspection test with a inherited role (nullability changes in a inherited role)
- [ ] Docs
- [ ] Changelog
Co-authored-by: Vamshi Surabhi <6562944+0x777@users.noreply.github.com>
GitOrigin-RevId: 3b8ee1e11f5ceca80fe294f8c074d42fbccfec63
2021-03-08 14:14:13 +03:00
- server: inherited roles for PG queries and subscription
2021-04-06 06:25:02 +03:00
- server: replaces postgres LISTEN/NOTIFY channel with lightweight polling for metadata syncing in order to resolve proxy issues
2021-03-09 12:24:21 +03:00
- server: fix issue when a remote relationship's joining field had a custom GraphQL name defined (fix #6626 )
2021-03-10 11:54:53 +03:00
- server: fix handling of nullable object relationships (fix #6633 )
2021-03-10 13:44:15 +03:00
- console: add inherited roles support (#483)
- console: add permissions support for mssql tables (#677)
2021-03-09 23:20:01 +03:00
- cli: support rest endpoints
2021-03-09 08:56:48 +03:00
- cli: support mssql sources
- cli: use relative paths in metadata !include directives
2021-03-09 09:43:41 +03:00
- cli: rename `--database` flag in `migrate` and `seed` command to `--database-name`
2021-03-09 23:20:01 +03:00
- cli: support inherited roles
2021-03-04 17:29:27 +03:00
## v2.0.0-alpha.3
### Bug fixes and improvements
2021-02-25 12:57:22 +03:00
- server/mssql: fix malformed JSON answer on empty tables
2021-02-24 15:52:21 +03:00
- server/mssql: fix runtime errors when selecting geography/geometry columns
2021-02-25 21:15:55 +03:00
- server/mssql: supports connection pooling to sql server
2021-03-05 21:32:16 +03:00
- server/mssql: fix text values erroneously being parsed as varchar
2021-03-02 07:26:31 +03:00
- server: improve errors messages for inconsistent sources
2021-03-03 17:17:37 +03:00
- console: add relationship tab for mssql tables (#677)
2021-03-04 09:49:38 +03:00
- build: fix the packaging of static console assets (fix #6610 )
2021-03-10 08:25:12 +03:00
- server: make REST endpoint errors compatible with inconsistent metadata
2021-03-04 09:49:38 +03:00
2021-02-24 15:52:21 +03:00
2021-03-04 17:29:27 +03:00
## v2.0.0-alpha.2
2021-02-23 20:37:27 +03:00
### MSSQL support
It's now possible to add a MSSQL server as a source. For now, only read-only queries and subscriptions are supported.
2021-03-01 23:52:49 +03:00
See the documentation at `graphql/core/databases/ms-sql-server` for more information.
2021-02-23 20:37:27 +03:00
2021-03-04 17:29:27 +03:00
## v2.0.0-alpha.1
Bunch of bug fixes and refactor for generalized backends: https://github.com/hasura/graphql-engine/compare/v1.4.0-alpha.2...v2.0.0-alpha.1
## v1.4.0-alpha.2
2021-02-16 11:08:19 +03:00
### Inconsistent Metadata
Add `allow_inconsistent_metadata` option to `replace_metadata` API.
This will replace metadata even if there are inconsistency errors,
returning a 200 response code and `is_consistent` and `inconsistent_objects`
keys in the response body.
2021-02-01 15:57:34 +03:00
### Bug fixes and improvements
(Add entries here in the order of: server, console, cli, docs, others)
- server: fix issue of not exposing mutation functions to the admin role when function permissions are inferred (fix #6503 )
2021-02-19 11:46:12 +03:00
- server: add "resource_version" field to metadata for concurrency control - disable lookup during migrations
2021-02-22 13:20:27 +03:00
- server: fix issue with queries on character column types (close #6217 )
2021-02-22 10:52:42 +03:00
- server: optimize resolving source. Resolving a source would create connection pools every time. Optimize that to re-create connection pools only when necessary. (#609)
2021-02-23 04:19:56 +03:00
- server: fix issues with remote schema introspection and queries over TLS.
2021-02-24 13:12:12 +03:00
- server: Prohibit Invalid slashes, duplicate variables, subscriptions for REST endpoints
- server: Prohibit non-singular query definitions for REST endpoints
2021-03-03 16:02:00 +03:00
- server: better handling for one-to-one relationships via both `manual_configuration` and `foreign_key_constraint_on` (#2576)
2021-02-01 15:57:34 +03:00
## v1.4.0-alpha.1
2021-01-29 04:02:34 +03:00
### REST Endpoints
The RESTified GraphQL Endpoints API allows for the use of a REST interface to saved GraphQL queries and mutations.
Users specify the query or mutation they wish to make available, as well a URL template. Segments of the URL template can potentially capture data to be used as GraphQL variables.
See the documentation at `graphql/core/api-reference/restified` for more information.
2020-10-07 13:23:17 +03:00
### Heterogeneous execution
Previous releases have allowed queries to request data from either Postgres or remote schemas, but not both. This release removes that restriction, so multiple data sources may be mixed within a single query. For example, GraphQL Engine can execute a query like
```
query {
articles {
title
}
weather {
temperature
}
}
```
where the articles are fetched from the database, and the weather is fetched from a remote server.
2020-11-18 21:04:57 +03:00
### Support tracking VOLATILE SQL functions as mutations. (closing #1514)
Previously we could only track `STABLE` or `IMMUTABLE` functions, and only as
queries. Now the version 2 of `track_table` also supports tracking functions as
mutations:
```
{
"type": "track_function",
"version": 2,
"args": {
"function": {
"schema": "public",
"name": "some_volatile_function"
},
"configuration": {
"exposed_as": "mutation"
}
}
}
```
2020-12-21 12:11:37 +03:00
### Remote schema permissions
Now, permissions can be configured for remote schemas as well, which works similar
to the permissions system of the postgres tables. Fields/arguments can be removed from the
schema and arguments can also be preset to limit the role from having unrestricted
access over it.
*NOTE*: To enable remote schema permissions, the graphql-engine needs to be started
either with the server flag ``--enable-remote-schema-permissions`` or the environment
variable ``HASURA_GRAPHQL_ENABLE_REMOTE_SCHEMA_PERMISSIONS`` set to ``true``.
2021-01-29 08:48:17 +03:00
### Function Permissions
Before volatile functions were supported, the permissions for functions were automatically inferred
from the select permission of the target table. Now, since volatile functions are supported we can't
do this anymore, so function permissions are introduced which will explicitly grant permission to
a function for a given role. A pre-requisite to adding a function permission is that the role should
have select permissions to the target table of the function.
2021-02-25 14:05:51 +03:00
### `ltree` comparison operators
Comparison operators on columns with ``ltree``, ``lquery`` or ``ltxtquery`` types are now supported, for searching through data stored in a hierarchical tree-like structure.
See the documentation at `graphql/core/queries/query-filters` more details on the currently supported ``ltree`` operators.
**Example query:** Select ancestors of an `ltree` argument
```
query {
tree (
where: {path: {_ancestor: "Tree.Collections.Pictures.Astronomy.Astronauts"}}
) {
path
}
}
```
**Example response:**
```
{
"data": {
"tree": [
{
"path": "Tree"
},
{
"path": "Tree.Collections"
},
{
"path": "Tree.Collections.Pictures"
},
{
"path": "Tree.Collections.Pictures.Astronomy"
},
{
"path": "Tree.Collections.Pictures.Astronomy.Astronauts"
}
]
}
}
```
2020-11-17 17:35:06 +03:00
### Breaking changes
2020-12-21 12:11:37 +03:00
- This release contains the [PDV refactor (#4111) ](https://github.com/hasura/graphql-engine/pull/4111 ), a significant rewrite of the internals of the server, which did include some breaking changes:
- The semantics of explicit `null` values in `where` filters have changed according to the discussion in [issue 704 ](https://github.com/hasura/graphql-engine/issues/704#issuecomment-635571407 ): an explicit `null` value in a comparison input object will be treated as an error rather than resulting in the expression being evaluated to `True` . For instance: `delete_users(where: {id: {_eq: $userId}}) { name }` will yield an error if `$userId` is `null` instead of deleting all users.
- The validation of required headers has been fixed (closing #14 and #3659 ):
- if a query selects table `bar` through table `foo` via a relationship, the required permissions headers will be the union of the required headers of table `foo` and table `bar` (we used to only check the headers of the root table);
- if an insert does not have an `on_conflict` clause, it will not require the update permissions headers.
2021-01-29 08:48:17 +03:00
- This release contains the remote schema permissions feature, which introduces a breaking change:
2020-11-17 17:35:06 +03:00
2021-01-29 08:48:17 +03:00
Earlier, remote schemas were considered to be a public entity and all the roles had unrestricted
access to the remote schema. If remote schema permissions are enabled in the graphql-engine, a given
remote schema will only be accessible to a role ,if the role has permissions configured for the said remote schema
and be accessible according to the permissions that were configured for the role.
2020-11-17 17:35:06 +03:00
### Bug fixes and improvements
(Add entries here in the order of: server, console, cli, docs, others)
2021-02-03 10:10:39 +03:00
- server: add `request` field to webhook POST body containing the GraphQL query/mutation, its name, and any variables passed (close #2666 )
2020-12-22 13:41:39 +03:00
- server: fix a regression where variables in fragments weren't accepted (fix #6303 )
server: give stack traces when encountering conflicting type definitions (#150)
Since PDV, introspection queries are parsed by a certain kind of reflection where during the GraphQL schema generation, we collect all GraphQL types used during schema generation to generate answers to introspection queries. This has a great advantage, namely that we don't need to keep track of which types are being used in our schema, as this information is extracted after the fact.
But what happens when we encounter two types with the same name in the GraphQL schema? Well, they better be the same, otherwise we likely made a programming error. So what do we do when we *do* encounter a conflict? So far, we've been throwing a rather generic error message, namely `found conflicting definitions for <typename> when collecting types from the schema`. It does not specify what the conflict is, or how it arose. In fact, I'm a little bit hesitant to output more information about what the conflict is, because we support many different kinds of GraphQL types, and these can have disagreements in many different ways. It'd be a bit tiring (not to mention error-prone) to spell this out explicitly for all types. And, in any case, at the moment our equality checks for types is incorrect anyway, as we are avoiding implementing a certain recursive equality checking algorithm.
As it turns out, type conflicts arise not just due to programming errors, but also arise naturally under certain configurations. @codingkarthik encountered an interesting case recently where adding a specific remote and a single unrelated database table would result in a conflict in our Relay schema. It was not readily visible how this conflict arose: this took significant engineering effort.
This adds stack traces to type collection, so that we can inform the user where the type conflict is taking place. The origin of the above conflict can easily be spotted using this PR. Here's a sample error message:
```
Found conflicting definitions for "PageInfo". The definition at "mutation_root.UpdateUser.favourites.anime.edges.node.characters.pageInfo" differs from the the definition at "query_root.test_connection.pageInfo"
```
Co-authored-by: Antoine Leblanc <antoine@hasura.io>
GitOrigin-RevId: d4c01c243022d8570b3c057b168a61c3033244ff
2020-12-04 18:36:57 +03:00
- server: output stack traces when encountering conflicting GraphQL types in the schema
2020-11-17 17:35:06 +03:00
- server: add `--websocket-compression` command-line flag for enabling websocket compression (fix #3292 )
- server: some mutations that cannot be performed will no longer be in the schema (for instance, `delete_by_pk` mutations won't be shown to users that do not have select permissions on all primary keys) (#4111)
- server: treat the absence of `backend_only` configuration and `backend_only: false` equally (closing #5059 ) (#4111)
- server: accept only non-negative integers for batch size and refetch interval (close #5653 ) (#5759)
- server: Configurable websocket keep-alive interval. Add `--websocket-keepalive` command-line flag and `HASURA_GRAPHQL_WEBSOCKET_KEEPALIVE` env variable (fix #3539 )
- server: validate remote schema queries (fixes #4143 )
- server: introduce optional custom table name in table configuration to track the table according to the custom name. The `set_table_custom_fields` API has been deprecated, A new API `set_table_customization` has been added to set the configuration. (#3811)
2020-11-24 15:19:16 +03:00
- server: support joining Int or String scalar types to ID scalar type in remote relationship
2020-11-27 13:53:58 +03:00
- server: add support for POSIX operators (close #4317 ) (#6172)
2020-12-04 11:37:42 +03:00
- server: do not block catalog migration on inconsistent metadata
2020-12-21 21:56:00 +03:00
- server: update `forkImmortal` function to log more information, i.e log starting of threads and log asynchronous and synchronous exception.
- server: various changes to ensure timely cleanup of background threads and other resources in the event of a SIGTERM signal.
2020-12-24 13:11:05 +03:00
- server: fix issue when the `relationships` field in `objects` field is passed `[]` in the `set_custom_types` API (fix #6357 )
2021-01-06 23:21:39 +03:00
- server: fix issue with event triggers defined on a table which is partitioned (fixes #6261 )
2021-01-18 09:56:25 +03:00
- server: action array relationships now support the same input arguments (such as where or distinct_on) as usual relationships
- server: action array relationships now support aggregate relationships
2021-01-05 17:46:55 +03:00
- server: fix issue with non-optional fields of the remote schema being added as optional in the graphql-engine (fix #6401 )
2021-01-13 11:38:13 +03:00
- server: accept new config `allowed_skew` in JWT config to provide leeway for JWT expiry (fixes #2109 )
2021-01-12 15:03:21 +03:00
- server: fix issue with query actions with relationship with permissions configured on the remote table (fix #6385 )
2021-01-19 20:25:52 +03:00
- server: always log the `request_id` at the `detail.request_id` path for both `query-log` and `http-log` (#6244)
2021-01-18 16:51:36 +03:00
- server: fix issue with `--stringify-numeric-types` not stringifying aggregate fields (fix #5704 )
2021-01-19 23:56:53 +03:00
- server: derive permissions for remote relationship field from the corresponding remote schema's permissions
2021-02-15 16:32:19 +03:00
- server: terminate a request if time to acquire connection from pool exceeds configurable timeout (#6326)
2021-01-21 19:49:46 +03:00
- server: fix issue with mapping session variables to standard JWT claims (fix #6449 )
2021-02-03 17:06:30 +03:00
- server: support tracking of functions that return a single row (fix #4299 )
2021-02-12 04:34:00 +03:00
- server: reduce memory usage consumption of the schema cache structures, and fix a memory leak
2021-02-20 16:45:49 +03:00
- server: add source name in livequery logs
2021-02-25 14:05:51 +03:00
- server: support ltree comparison operators (close #625 )
2021-02-25 12:02:43 +03:00
- server: support parsing JWT from cookie header (fix #2183 )
2020-11-17 17:35:06 +03:00
- console: allow user to cascade Postgres dependencies when dropping Postgres objects (close #5109 ) (#5248)
- console: mark inconsistent remote schemas in the UI (close #5093 ) (#5181)
- console: remove ONLY as default for ALTER TABLE in column alter operations (close #5512 ) #5706
2021-02-01 13:08:53 +03:00
- console: add onboarding helper for new users (#355)
2020-11-17 17:35:06 +03:00
- console: add option to flag an insertion as a migration from `Data` section (close #1766 ) (#4933)
- console: down migrations improvements (close #3503 , #4988 ) (#4790)
- console: allow setting computed fields for views (close #6168 ) (#6174)
2020-11-24 19:17:02 +03:00
- console: select first operator by default on the browse rows screen (close #5729 ) (#6032)
2020-12-22 17:18:02 +03:00
- console: fix allow-list not getting added to metadata/allow_list.yaml in CLI mode (close #6374 )
- console: misc bug fixes (close #4785 , #6330 , #6288 )
2021-01-12 00:58:13 +03:00
- console: allow setting table custom name (#212)
2021-01-13 07:21:49 +03:00
- console: support tracking VOLATILE functions as mutations or queries (close #6228 )
2021-01-26 21:12:04 +03:00
- console: show only compatible postgres functions in computed fields section (close #5155 ) (#5978)
2021-01-22 16:52:21 +03:00
- console: added export data option on browse rows page (close #1438 #5158 )
2021-01-28 02:59:27 +03:00
- console: add session argument field for computed fields (close #5154 ) (#5610)
2021-02-12 20:01:41 +03:00
- console: add support for function permissions (#413)
2021-02-19 01:18:51 +03:00
- console: add tree view for Data Tab UI (#524)
2021-02-23 14:23:01 +03:00
- console: add support for RESTified Endpoints (#569)
2020-11-17 17:35:06 +03:00
- cli: add missing global flags for seed command (#5565)
- cli: allow seeds as alias for seed command (#5693)
2020-12-24 08:06:35 +03:00
- cli: fix action timeouts not being picked up in metadata operations (#6220)
2020-12-01 15:21:45 +03:00
- build: add `test_server_pg_13` to the CI to run the server tests on Postgres v13 (#6070)
2020-11-17 17:35:06 +03:00
## v1.3.3
2020-08-31 19:40:01 +03:00
### Server - Support for mapping session variables to default JWT claims
Some auth providers do not let users add custom claims in JWT. In such cases, the server can take a JWT configuration option called `claims_map` to specify a mapping of Hasura session variables to values in existing claims via JSONPath or literal values.
Example:-
Consider the following JWT claim:
```
{
"sub": "1234567890",
"name": "John Doe",
"admin": true,
"iat": 1516239022,
"user": {
"id": "ujdh739kd",
"appRoles": ["user", "editor"]
}
}
```
The corresponding JWT config can be:
```
{
"type":"RS512",
"key": "< The public Key > ",
"claims_map": {
"x-hasura-allowed-roles": {"path":"$.user.appRoles"},
"x-hasura-default-role": {"path":"$.user.appRoles[0]","default":"user"},
"x-hasura-user-id": {"path":"$.user.id"}
}
}
```
2020-10-30 17:52:55 +03:00
### Metadata Types SDK
The types and documentation comments for Metadata V2 have been converted into JSON/YAML Schema, and used to autogenerate type definitions for popular languages.
This enables users to build type-safe tooling in the language of their choice around Metadata interactions and automations.
Additionally, the JSON/YAML Schemas can be used to provide IntelliSense and autocomplete + documentation when interacting with Metadata YAML/JSON files.
For a more comprehensive overview, please see [the readme located here ](./contrib/metadata-types/README.md )
**Sample Code**
```ts
2020-11-27 13:53:58 +03:00
import { TableEntry } from "../generated/HasuraMetadataV2";
2020-10-30 17:52:55 +03:00
const newTable: TableEntry = {
table: { schema: "public", name: "user" },
select_permissions: [
{
role: "user",
permission: {
limit: 100,
allow_aggregations: false,
columns: ["id", "name", "etc"],
computed_fields: ["my_computed_field"],
filter: {
id: { _eq: "X-Hasura-User-ID" },
},
},
},
],
2020-11-27 13:53:58 +03:00
};
2020-10-30 17:52:55 +03:00
```
**IntelliSense Example**
![](./contrib/metadata-types/json-schema-typecheck-demo.gif)
2020-11-18 11:59:16 +03:00
### Breaking changes
#### PDV
This release contains the [PDV refactor (#4111) ](https://github.com/hasura/graphql-engine/pull/4111 ), a significant rewrite of the internals of the server, which did include some breaking changes:
- The semantics of explicit `null` values in `where` filters have changed according to the discussion in [issue 704 ](https://github.com/hasura/graphql-engine/issues/704#issuecomment-635571407 ): an explicit `null` value in a comparison input object will be treated as an error rather than resulting in the expression being evaluated to `True` . For instance: `delete_users(where: {id: {_eq: $userId}}) { name }` will yield an error if `$userId` is `null` instead of deleting all users.
- The validation of required headers has been fixed (closing #14 and #3659 ):
- if a query selects table `bar` through table `foo` via a relationship, the required permissions headers will be the union of the required headers of table `foo` and table `bar` (we used to only check the headers of the root table);
- if an insert does not have an `on_conflict` clause, it will not require the update permissions headers.
#### Remote Relationship
In this release, a breaking change has been introduced:
In a remote relationship query, the remote schema will be queried when all of the joining arguments
are **not** `null` values. When there are `null` value(s), the remote schema won't be queried and the
response of the remote relationship field will be `null` . Earlier, the remote schema
was queried with the `null` value arguments and the response depended upon how the remote schema handled the `null`
arguments.
2020-08-21 11:09:16 +03:00
2020-08-17 14:40:27 +03:00
### Bug fixes and improvements
(Add entries here in the order of: server, console, cli, docs, others)
2020-10-27 22:52:19 +03:00
2020-08-26 10:49:04 +03:00
- server: allow remote relationships joining `type` column with `[type]` input argument as spec allows this coercion (fixes #5133 )
2020-09-10 12:30:34 +03:00
- server: add action-like URL templating for event triggers and remote schemas (fixes #2483 )
2020-09-08 09:56:41 +03:00
- server: change `created_at` column type from `timestamp` to `timestamptz` for scheduled triggers tables (fix #5722 )
2020-09-16 12:53:17 +03:00
- server: allow configuring timeouts for actions (fixes #4966 )
2020-10-28 13:21:53 +03:00
- server: fix bug which arised when renaming a table which had a manual relationship defined (close #4158 )
2020-10-06 18:22:09 +03:00
- server: limit the length of event trigger names (close #5786 )
2020-11-27 13:53:58 +03:00
**NOTE:** If you have event triggers with names greater than 42 chars, then you should update their names to avoid running into Postgres identifier limit bug (#5786)
2020-11-17 17:35:06 +03:00
- server: enable HASURA_GRAPHQL_PG_CONN_LIFETIME by default to reclaim memory
2020-10-22 16:26:42 +03:00
- server: fix issue with tracking custom functions that return `SETOF` materialized view (close #5294 ) (#5945)
2020-10-29 14:30:19 +03:00
- server: allow remote relationships with union, interface and enum type fields as well (fixes #5875 ) (#6080)
2020-11-17 17:35:06 +03:00
- server: Fix fine-grained incremental cache invalidation (fix #6027 )
This issue could cause enum table values to sometimes not be properly reloaded without restarting `graphql-engine` . Now a `reload_metadata` API call (or clicking “Reload enum values” in the console) should consistently force a reload of all enum table values.
2020-11-12 12:25:48 +03:00
- server: fix event trigger cleanup on deletion via replace_metadata (fix #5461 ) (#6137)
2020-11-27 13:53:58 +03:00
**WARNING** : This can cause significant load on PG on startup if you have lots of event triggers. Delay in starting up is expected.
2020-10-13 14:07:46 +03:00
- console: add notifications (#5070)
2020-11-12 12:25:48 +03:00
- cli: fix bug in metadata apply which made the server aquire some redundant and unnecessary locks (close #6115 )
2020-11-17 17:35:06 +03:00
- cli: fix cli-migrations-v2 image failing to run as a non root user (close #4651 , close #5333 )
- cli: fix issue with cli binary on latest Mac (Big Sur) (fix #5462 )
Rewrite GraphQL schema generation and query parsing (close #2801) (#4111)
Aka “the PDV refactor.” History is preserved on the branch 2801-graphql-schema-parser-refactor.
* [skip ci] remove stale benchmark commit from commit_diff
* [skip ci] Check for root field name conflicts between remotes
* [skip ci] Additionally check for conflicts between remotes and DB
* [skip ci] Check for conflicts in schema when tracking a table
* [skip ci] Fix equality checking in GraphQL AST
* server: fix mishandling of GeoJSON inputs in subscriptions (fix #3239) (#4551)
* Add support for multiple top-level fields in a subscription to improve testability of subscriptions
* Add an internal flag to enable multiple subscriptions
* Add missing call to withConstructorFn in live queries (fix #3239)
Co-authored-by: Alexis King <lexi.lambda@gmail.com>
* Scheduled triggers (close #1914) (#3553)
server: add scheduled triggers
Co-authored-by: Alexis King <lexi.lambda@gmail.com>
Co-authored-by: Marion Schleifer <marion@hasura.io>
Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
Co-authored-by: Aleksandra Sikora <ola.zxcvbnm@gmail.com>
* dev.sh: bump version due to addition of croniter python dependency
* server: fix an introspection query caching issue (fix #4547) (#4661)
Introspection queries accept variables, but we need to make sure to
also touch the variables that we ignore, so that an introspection
query is marked not reusable if we are not able to build a correct
query plan for it.
A better solution here would be to deal with such unused variables
correctly, so that more introspection queries become reusable.
An even better solution would be to type-safely track *how* to reuse
which variables, rather than to split the reusage marking from the
planning.
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
* flush log buffer on exception in mkWaiApp ( fix #4772 ) (#4801)
* flush log buffer on exception in mkWaiApp
* add comment to explain the introduced change
* add changelog
* allow logging details of a live query polling thread (#4959)
* changes for poller-log
add various multiplexed query info in poller-log
* minor cleanup, also fixes a bug which will return duplicate data
* Live query poller stats can now be logged
This also removes in-memory stats that are collected about batched
query execution as the log lines when piped into an monitoring tool
will give us better insights.
* allow poller-log to be configurable
* log minimal information in the livequery-poller-log
Other information can be retrieved from /dev/subscriptions/extended
* fix few review comments
* avoid marshalling and unmarshalling from ByteString to EncJSON
* separate out SubscriberId and SubscriberMetadata
Co-authored-by: Anon Ray <rayanon004@gmail.com>
* Don't compile in developer APIs by default
* Tighten up handling of admin secret, more docs
Store the admin secret only as a hash to prevent leaking the secret
inadvertently, and to prevent timing attacks on the secret.
NOTE: best practice for stored user passwords is a function with a
tunable cost like bcrypt, but our threat model is quite different (even
if we thought we could reasonably protect the secret from an attacker
who could read arbitrary regions of memory), and bcrypt is far too slow
(by design) to perform on each request. We'd have to rely on our
(technically savvy) users to choose high entropy passwords in any case.
Referencing #4736
* server/docs: add instructions to fix loss of float precision in PostgreSQL <= 11 (#5187)
This adds a server flag, --pg-connection-options, that can be used to set a PostgreSQL connection parameter, extra_float_digits, that needs to be used to avoid loss of data on older versions of PostgreSQL, which have odd default behavior when returning float values. (fixes #5092)
* [skip ci] Add new commits from master to the commit diff
* [skip ci] serve default directives (skip & include) over introspection
* [skip ci] Update non-Haskell assets with the version on master
* server: refactor GQL execution check and config API (#5094)
Co-authored-by: Vamshi Surabhi <vamshi@hasura.io>
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
* [skip ci] fix js issues in tests by pinning dependencies version
* [skip ci] bump graphql version
* [skip ci] Add note about memory usage
* generalize query execution logic on Postgres (#5110)
* generalize PGExecCtx to support specialized functions for various operations
* fix tests compilation
* allow customising PGExecCtx when starting the web server
* server: changes catalog initialization and logging for pro customization (#5139)
* new typeclass to abstract the logic of QueryLog-ing
* abstract the logic of logging websocket-server logs
introduce a MonadWSLog typeclass
* move catalog initialization to init step
expose a helper function to migrate catalog
create schema cache in initialiseCtx
* expose various modules and functions for pro
* [skip ci] cosmetic change
* [skip ci] fix test calling a mutation that does not exist
* [skip ci] minor text change
* [skip ci] refactored input values
* [skip ci] remove VString Origin
* server: fix updating of headers behaviour in the update cron trigger API and create future events immediately (#5151)
* server: fix bug to update headers in an existing cron trigger and create future events
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
* Lower stack chunk size in RTS to reduce thread STACK memory (closes #5190)
This reduces memory consumption for new idle subscriptions significantly
(see linked ticket).
The hypothesis is: we fork a lot of threads per websocket, and some of
these use slightly more than the initial 1K stack size, so the first
overflow balloons to 32K, when significantly less is required.
However: running with `+RTS -K1K -xc` did not seem to show evidence of
any overflows! So it's a mystery why this improves things.
GHC should probably also be doubling the stack buffer at each overflow
or doing something even smarter; the knobs we have aren't so helpful.
* [skip ci] fix todo and schema generation for aggregate fields
* 5087 libpq pool leak (#5089)
Shrink libpq buffers to 1MB before returning connection to pool. Closes #5087
See: https://github.com/hasura/pg-client-hs/pull/19
Also related: #3388 #4077
* bump pg-client-hs version (fixes a build issue on some environments) (#5267)
* do not use prepared statements for mutations
* server: unlock scheduled events on graceful shutdown (#4928)
* Fix buggy parsing of new --conn-lifetime flag in 2b0e3774
* [skip ci] remove cherry-picked commit from commit_diff.txt
* server: include additional fields in scheduled trigger webhook payload (#5262)
* include scheduled triggers metadata in the webhook body
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
* server: call the webhook asynchronously in event triggers (#5352)
* server: call the webhook asynchronosly in event triggers
* Expose all modules in Cabal file (#5371)
* [skip ci] update commit_diff.txt
* [skip ci] fix cast exp parser & few TODOs
* [skip ci] fix remote fields arguments
* [skip ci] fix few more TODO, no-op refactor, move resolve/action.hs to execute/action.hs
* Pass environment variables around as a data structure, via @sordina (#5374)
* Pass environment variables around as a data structure, via @sordina
* Resolving build error
* Adding Environment passing note to changelog
* Removing references to ILTPollerLog as this seems to have been reintroduced from a bad merge
* removing commented-out imports
* Language pragmas already set by project
* Linking async thread
* Apply suggestions from code review
Use `runQueryTx` instead of `runLazyTx` for queries.
* remove the non-user facing entry in the changelog
Co-authored-by: Phil Freeman <paf31@cantab.net>
Co-authored-by: Phil Freeman <phil@hasura.io>
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
* [skip ci] fix: restrict remote relationship field generation for hasura queries
* [skip ci] no-op refactor; move insert execution code from schema parser module
* server: call the webhook asynchronously in event triggers (#5352)
* server: call the webhook asynchronosly in event triggers
* Expose all modules in Cabal file (#5371)
* [skip ci] update commit_diff.txt
* Pass environment variables around as a data structure, via @sordina (#5374)
* Pass environment variables around as a data structure, via @sordina
* Resolving build error
* Adding Environment passing note to changelog
* Removing references to ILTPollerLog as this seems to have been reintroduced from a bad merge
* removing commented-out imports
* Language pragmas already set by project
* Linking async thread
* Apply suggestions from code review
Use `runQueryTx` instead of `runLazyTx` for queries.
* remove the non-user facing entry in the changelog
Co-authored-by: Phil Freeman <paf31@cantab.net>
Co-authored-by: Phil Freeman <phil@hasura.io>
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
* [skip ci] implement header checking
Probably closes #14 and #3659.
* server: refactor 'pollQuery' to have a hook to process 'PollDetails' (#5391)
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
* update pg-client (#5421)
* [skip ci] update commit_diff
* Fix latency buckets for telemetry data
These must have gotten messed up during a refactor. As a consequence
almost all samples received so far fall into the single erroneous 0 to
1K seconds (originally supposed to be 1ms?) bucket.
I also re-thought what the numbers should be, but these are still
arbitrary and might want adjusting in the future.
* [skip ci] include the latest commit compared against master in commit_diff
* [skip ci] include new commits from master in commit_diff
* [skip ci] improve description generation
* [skip ci] sort all introspect arrays
* [skip ci] allow parsers to specify error codes
* [skip ci] fix integer and float parsing error code
* [skip ci] scalar from json errors are now parse errors
* [skip ci] fixed negative integer error message and code
* [skip ci] Re-fix nullability in relationships
* [skip ci] no-op refactor and removed couple of FIXMEs
* [skip ci] uncomment code in 'deleteMetadataObject'
* [skip ci] Fix re-fix of nullability for relationships
* [skip ci] fix default arguments error code
* [skip ci] updated test error message
!!! WARNING !!!
Since all fields accept `null`, they all are technically optional in
the new schema. Meaning there's no such thing as a missing mandatory
field anymore: a field that doesn't have a default value, and which
therefore isn't labelled as "optional" in the schema, will be assumed
to be null if it's missing, meaning it isn't possible anymore to have
an error for a missing mandatory field. The only possible error is now
when a optional positional argument is omitted but is not the last
positional argument.
* [skip ci] cleanup of int scalar parser
* [skip ci] retro-compatibility of offset as string
* [skip ci] Remove commit from commit_diff.txt
Although strictly speaking we don't know if this will work correctly in PDV
if we would implement query plan caching, the fact is that in the theoretical
case that we would have the same issue in PDV, it would probably apply not just
to introspection, and the fix would be written completely differently. So this
old commit is of no value to us other than the heads-up "make sure query plan
caching works correctly even in the presence of unused variables", which is
already part of the test suite.
* Add MonadTrace and MonadExecuteQuery abstractions (#5383)
* [skip ci] Fix accumulation of input object types
Just like object types, interface types, and union types, we have to avoid
circularities when collecting input types from the GraphQL AST.
Additionally, this fixes equality checks for input object types (whose fields
are unordered, and hence should be compared as sets) and enum types (ditto).
* [skip ci] fix fragment error path
* [skip ci] fix node error code
* [skip ci] fix paths in insert queries
* [skip ci] fix path in objects
* [skip ci] manually alter node id path for consistency
* [skip ci] more node error fixups
* [skip ci] one last relay error message fix
* [skip ci] update commit_diff
* Propagate the trace context to event triggers (#5409)
* Propagate the trace context to event triggers
* Handle missing trace and span IDs
* Store trace context as one LOCAL
* Add migrations
* Documentation
* changelog
* Fix warnings
* Respond to code review suggestions
* Respond to code review
* Undo changelog
* Update CHANGELOG.md
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
* server: log request/response sizes for event triggers (#5463)
* server: log request/response sizes for event triggers
event triggers (and scheduled triggers) now have request/response size
in their logs.
* add changelog entry
* Tracing: Simplify HTTP traced request (#5451)
Remove the Inversion of Control (SuspendRequest) and simplify
the tracing of HTTP Requests.
Co-authored-by: Phil Freeman <phil@hasura.io>
* Attach request ID as tracing metadata (#5456)
* Propagate the trace context to event triggers
* Handle missing trace and span IDs
* Store trace context as one LOCAL
* Add migrations
* Documentation
* Include the request ID as trace metadata
* changelog
* Fix warnings
* Respond to code review suggestions
* Respond to code review
* Undo changelog
* Update CHANGELOG.md
* Typo
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
* server: add logging for action handlers (#5471)
* server: add logging for action handlers
* add changelog entry
* change action-handler log type from internal to non-internal
* fix action-handler-log name
* server: pass http and websocket request to logging context (#5470)
* pass request body to logging context in all cases
* add message size logging on the websocket API
this is required by graphql-engine-pro/#416
* message size logging on websocket API
As we need to log all messages recieved/sent by the websocket server,
it makes sense to log them as part of the websocket server event logs.
Previously message recieved were logged inside the onMessage handler,
and messages sent were logged only for "data" messages (as a server event log)
* fix review comments
Co-authored-by: Phil Freeman <phil@hasura.io>
* server: stop eventing subsystem threads when shutting down (#5479)
* server: stop eventing subsystem threads when shutting down
* Apply suggestions from code review
Co-authored-by: Karthikeyan Chinnakonda <chkarthikeyan95@gmail.com>
Co-authored-by: Phil Freeman <phil@hasura.io>
Co-authored-by: Phil Freeman <paf31@cantab.net>
Co-authored-by: Karthikeyan Chinnakonda <chkarthikeyan95@gmail.com>
* [skip ci] update commit_diff with new commits added in master
* Bugfix to support 0-size HASURA_GRAPHQL_QUERY_PLAN_CACHE_SIZE
Also some minor refactoring of bounded cache module:
- the maxBound check in `trim` was confusing and unnecessary
- consequently trim was unnecessary for lookupPure
Also add some basic tests
* Support only the bounded cache, with default HASURA_GRAPHQL_QUERY_PLAN_CACHE_SIZE of 4000. Closes #5363
* [skip ci] remove merge commit from commit_diff
* server: Fix compiler warning caused by GHC upgrade (#5489)
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
* [skip ci] update all non server code from master
* [skip ci] aligned object field error message with master
* [skip ci] fix remaining undefined?
* [skip ci] remove unused import
* [skip ci] revert to previous error message, fix tests
* Move nullableType/nonNullableType to Schema.hs
These are functions on Types, not on Parsers.
* [skip ci] fix setup to fix backend only test
the order in which permission checks are performed on the branch is
slightly different than on master, resulting in a slightly different
error if there are no other mutations the user has access to. By
adding update permissions, we go back to the expected case.
* [skip ci] fix insert geojson tests to reflect new paths
* [skip ci] fix enum test for better error message
* [skip ci] fix header test for better error message
* [skip ci] fix fragment cycle test for better error message
* [skip ci] fix error message for type mismatch
* [skip ci] fix variable path in test
* [skip ci] adjust tests after bug fix
* [skip ci] more tests fixing
* Add hdb_catalog.current_setting abstraction for reading Hasura settings
As the comment in the function’s definition explains, this is needed to
work around an awkward Postgres behavior.
* [skip ci] Update CONTRIBUTING.md to mention Node setup for Python tests
* [skip ci] Add missing Python tests env var to CONTRIBUTING.md
* [skip ci] fix order of result when subscription is run with multiple nodes
* [skip ci] no-op refactor: fix a warning in Internal/Parser.hs
* [skip ci] throw error when a subscription contains remote joins
* [skip ci] Enable easier profiling by hiding AssertNF behind a flag
In order to compile a profiling build, run:
$ cabal new-build -f profiling --enable-profiling
* [skip ci] Fix two warnings
We used to lookup the objects that implement a given interface by filtering all
objects in the schema document. However, one of the tests expects us to
generate a warning if the provided `implements` field of an introspection query
specifies an object not implementing some interface. So we use that field
instead.
* [skip ci] Fix warnings by commenting out query plan caching
* [skip ci] improve masking/commenting query caching related code & few warning fixes
* [skip ci] Fixed compiler warnings in graphql-parser-hs
* Sync non-Haskell assets with master
* [skip ci] add a test inserting invalid GraphQL but valid JSON value in a jsonb column
* [skip ci] Avoid converting to/from Map
* [skip ci] Apply some hlint suggestions
* [skip ci] remove redundant constraints from buildLiveQueryPlan and explainGQLQuery
* [skip ci] add NOTEs about missing Tracing constraints in PDV from master
* Remove -fdefer-typed-holes, fix warnings
* Update cabal.project.freeze
* Limit GHC’s heap size to 8GB in CI to avoid the OOM killer
* Commit package-lock.json for Python tests’ remote schema server
* restrict env variables start with HASURA_GRAPHQL_ for headers configuration in actions, event triggers & remote schemas (#5519)
* restrict env variables start with HASURA_GRAPHQL_ for headers definition in actions & event triggers
* update CHANGELOG.md
* Apply suggestions from code review
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
* add test for table_by_pk node when roles doesn't have permission to PK
* [skip ci] fix introspection query if any enum column present in primary key (fix #5200) (#5522)
* [skip ci] test case fix for a6450e126bc2d98bcfd3791501986e4627ce6c6f
* [skip ci] add tests to agg queries when role doesn't have access to any cols
* fix backend test
* Simplify subscription execution
* [skip ci] add test to check if required headers are present while querying
* Suppose, table B is related to table A and to query B certain headers are
necessary, then the test checks that we are throwing error when the header
is not set when B is queried through A
* fix mutations not checking for view mutability
* [skip ci] add variable type checking and corresponding tests
* [skip ci] add test to check if update headers are present while doing an upsert
* [skip ci] add positive counterparts to some of the negative permission tests
* fix args missing their description in introspect
* [skip ci] Remove unused function; insert missing markNotReusable call
* [skip ci] Add a Note about InputValue
* [skip ci] Delete LegacySchema/ 🎉
* [skip ci] Delete GraphQL/{Resolve,Validate}/ 🎉
* [skip ci] Delete top-level Resolve/Validate modules; tidy .cabal file
* [skip ci] Delete LegacySchema top-level module
Somehow I missed this one.
* fix input value to json
* [skip ci] elaborate on JSON objects in GraphQL
* [skip ci] add missing file
* [skip ci] add a test with subscription containing remote joins
* add a test with remote joins in mutation output
* [skip ci] Add some comments to Schema/Mutation.hs
* [skip ci] Remove no longer needed code from RemoteServer.hs
* [skip ci] Use a helper function to generate conflict clause parsers
* [skip ci] fix type checker error in fields with default value
* capitalize the header keys in select_articles_without_required_headers
* Somehow, this was the reason the tests were failing. I have no idea, why!
* [skip ci] Add a long Note about optional fields and nullability
* Improve comments a bit; simplify Schema/Common.hs a bit
* [skip ci] full implementation of 5.8.5 type checking.
* [skip ci] fix validation test teardown
* [skip ci] fix schema stitching test
* fix remote schema ignoring enum nullability
* [skip ci] fix fieldOptional to not discard nullability
* revert nullability of use_spheroid
* fix comment
* add required remote fields with arguments for tests
* [skip ci] add missing docstrings
* [skip ci] fixed description of remote fields
* [skip ci] change docstring for consistency
* fix several schema inconsistencies
* revert behaviour change in function arguments parsing
* fix remaining nullability issues in new schema
* minor no-op refactor; use isListType from graphql-parser-hs
* use nullability of remote schema node, while creating a Remote reln
* fix 'ID' input coercing & action 'ID' type relationship mapping
* include ASTs in MonadExecuteQuery
* needed for PRO code-base
* Delete code for "interfaces implementing ifaces" (draft GraphQL spec)
Previously I started writing some code that adds support for a future GraphQL
feature where interfaces may themselves be sub-types of other interfaces.
However, this code was incomplete, and partially incorrect. So this commit
deletes support for that entirely.
* Ignore a remote schema test during the upgrade/downgrade test
The PDV refactor does a better job at exposing a minimal set of types through
introspection. In particular, not every type that is present in a remote schema
is re-exposed by Hasura. The test
test_schema_stitching.py::TestRemoteSchemaBasic::test_introspection assumed that
all types were re-exposed, which is not required for GraphQL compatibility, in
order to test some aspect of our support for remote schemas.
So while this particular test has been updated on PDV, the PDV branch now does
not pass the old test, which we argue to be incorrect. Hence this test is
disabled while we await a release, after which we can re-enable it.
This also re-enables a test that was previously disabled for similar, though
unrelated, reasons.
* add haddock documentation to the action's field parsers
* Deslecting some tests in server-upgrade
Some tests with current build are failing on server upgrade
which it should not. The response is more accurate than
what it was.
Also the upgrade tests were not throwing errors when the test is
expected to return an error, but succeeds. The test framework is
patched to catch this case.
* [skip ci] Add a long Note about interfaces and object types
* send the response headers back to client after running a query
* Deselect a few more tests during upgrade/downgrade test
* Update commit_diff.txt
* change log kind from db_migrate to catalog_migrate (#5531)
* Show method and complete URI in traced HTTP calls (#5525)
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
* restrict env variables start with HASURA_GRAPHQL_ for headers configuration in actions, event triggers & remote schemas (#5519)
* restrict env variables start with HASURA_GRAPHQL_ for headers definition in actions & event triggers
* update CHANGELOG.md
* Apply suggestions from code review
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
* fix introspection query if any enum column present in primary key (fix #5200) (#5522)
* Fix telemetry reporting of transport (websocket was reported as http)
* add log kinds in cli-migrations image (#5529)
* add log kinds in cli-migrations image
* give hint to resolve timeout error
* minor changes and CHANGELOG
* server: set hasura.tracecontext in RQL mutations [#5542] (#5555)
* server: set hasura.tracecontext in RQL mutations [#5542]
* Update test suite
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
* Add bulldozer auto-merge and -update configuration
We still need to add the github app (as of time of opening this PR)
Afterwards devs should be able to allow bulldozer to automatically
"update" the branch, merging in parent when it changes, as well as
automatically merge when all checks pass.
This is opt-in by adding the `auto-update-auto-merge` label to the PR.
* Remove 'bulldozer' config, try 'kodiak' for auto-merge
see: https://github.com/chdsbd/kodiak
The main issue that bit us was not being able to auto update forked
branches, also:
https://github.com/palantir/bulldozer/issues/66
https://github.com/palantir/bulldozer/issues/145
* Cherry-picked all commits
* [skip ci] Slightly improve formatting
* Revert "fix introspection query if any enum column present in primary key (fix #5200) (#5522)"
This reverts commit 0f9a5afa59a88f6824f4d63d58db246a5ba3fb03.
This undoes a cherry-pick of 34288e1eb5f2c5dad9e6d1e05453dd52397dc970 that was
already done previously in a6450e126bc2d98bcfd3791501986e4627ce6c6f, and
subsequently fixed for PDV in 70e89dc250f8ddc6e2b7930bbe2b3eeaa6dbe1db
* Do a small bit of tidying in Hasura.GraphQL.Parser.Collect
* Fix cherry-picking work
Some previous cherry-picks ended up modifying code that is commented out
* [skip ci] clarified comment regarding insert representation
* [skip ci] removed obsolete todos
* cosmetic change
* fix action error message
* [skip ci] remove obsolete comment
* [skip ci] synchronize stylish haskell extensions list
* use previously defined scalar names in parsers rather than ad-hoc literals
* Apply most syntax hlint hints.
* Clarify comment on update mutation.
* [skip ci] Clarify what fields should be specified for objects
* Update "_inc" description.
* Use record types rather than tuples fo IntrospectionResult and ParsedIntrospection
* Get rid of checkFieldNamesUnique (use Data.List.Extended.duplicates)
* Throw more errors when collecting query root names
* [skip ci] clean column parser comment
* Remove dead code inserted in ab65b39
* avoid converting to non-empty list where not needed
* add note and TODO about the disabled checks in PDV
* minor refactor in remoteField' function
* Unify two getObject methods
* Nitpicks in Remote.hs
* Update CHANGELOG.md
* Revert "Unify two getObject methods"
This reverts commit bd6bb40355b3d189a46c0312eb52225e18be57b3.
We do need two different getObject functions as the corresponding error message is different
* Fix error message in Remote.hs
* Update CHANGELOG.md
Co-authored-by: Auke Booij <auke@tulcod.com>
* Apply suggested Changelog fix.
Co-authored-by: Auke Booij <auke@tulcod.com>
* Fix typo in Changelog.
* [skip ci] Update changelog.
* reuse type names to avoid duplication
* Fix Hashable instance for Definition
The presence of `Maybe Unique`, and an optional description, as part of
`Definition`s, means that `Definition`s that are considered `Eq`ual may get
different hashes. This can happen, for instance, when one object is memoized
but another is not.
* [skip ci] Update commit_diff.txt
* Bump parser version.
* Bump freeze file after changes in parser.
* [skip ci] Incorporate commits from master
* Fix developer flag in server/cabal.project.freeze
Co-authored-by: Auke Booij <auke@tulcod.com>
* Deselect a changed ENUM test for upgrade/downgrade CI
* Deselect test here as well
* [skip ci] remove dead code
* Disable more tests for upgrade/downgrade
* Fix which test gets deselected
* Revert "Add hdb_catalog.current_setting abstraction for reading Hasura settings"
This reverts commit 66e85ab9fbd56cca2c28a80201f6604fbe811b85.
* Remove circular reference in cabal.project.freeze
Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io>
Co-authored-by: Auke Booij <auke@hasura.io>
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
Co-authored-by: Marion Schleifer <marion@hasura.io>
Co-authored-by: Aleksandra Sikora <ola.zxcvbnm@gmail.com>
Co-authored-by: Brandon Simmons <brandon.m.simmons@gmail.com>
Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
Co-authored-by: Anon Ray <rayanon004@gmail.com>
Co-authored-by: rakeshkky <12475069+rakeshkky@users.noreply.github.com>
Co-authored-by: Anon Ray <ecthiender@users.noreply.github.com>
Co-authored-by: Vamshi Surabhi <vamshi@hasura.io>
Co-authored-by: Antoine Leblanc <antoine@hasura.io>
Co-authored-by: Brandon Simmons <brandon@hasura.io>
Co-authored-by: Phil Freeman <phil@hasura.io>
Co-authored-by: Lyndon Maydwell <lyndon@sordina.net>
Co-authored-by: Phil Freeman <paf31@cantab.net>
Co-authored-by: Naveen Naidu <naveennaidu479@gmail.com>
Co-authored-by: Karthikeyan Chinnakonda <chkarthikeyan95@gmail.com>
Co-authored-by: Nizar Malangadan <nizar-m@users.noreply.github.com>
Co-authored-by: Antoine Leblanc <crucuny@gmail.com>
Co-authored-by: Auke Booij <auke@tulcod.com>
2020-08-21 20:27:01 +03:00
- docs: add docs page on networking with docker (close #4346 ) (#4811)
2020-10-13 14:07:46 +03:00
- docs: add tabs for console / cli / api workflows (close #3593 ) (#4948)
2020-10-06 19:04:58 +03:00
- docs: add postgres concepts page to docs (close #4440 ) (#4471)
2020-11-02 15:20:04 +03:00
- docs: add guides on connecting hasura cloud to pg databases of different cloud vendors (#5948)
2020-09-09 10:49:32 +03:00
## `v1.3.2`
### Bug fixes and improvements
(Add entries here in the order of: server, console, cli, docs, others)
- server: fixes column masking in select permission for computed fields regression (fix #5696 )
2020-08-21 16:21:36 +03:00
## `v1.3.1`, `v1.3.1-beta.1`
2020-08-17 14:40:27 +03:00
2020-08-05 16:14:53 +03:00
### Breaking change
2020-08-21 11:09:16 +03:00
Headers from environment variables starting with `HASURA_GRAPHQL_` are not allowed
2020-08-05 16:14:53 +03:00
in event triggers, actions & remote schemas.
If you do have such headers configured, then you must update the header configuration before upgrading.
2020-06-29 16:28:03 +03:00
### Bug fixes and improvements
(Add entries here in the order of: server, console, cli, docs, others)
2020-08-05 17:08:36 +03:00
- server: fix failing introspection query when an enum column is part of a primary key (fixes #5200 )
2020-08-05 16:14:53 +03:00
- server: disallow headers from env variables starting with `HASURA_GRAPHQL_` in actions, event triggers & remote schemas (#5519)
2020-10-30 17:52:55 +03:00
**WARNING** : This might break certain deployments. See `Breaking change` section above.
2020-07-28 01:21:24 +03:00
- server: bugfix to allow HASURA_GRAPHQL_QUERY_PLAN_CACHE_SIZE of 0 (#5363)
2020-07-29 02:02:44 +03:00
- server: support only a bounded plan cache, with a default size of 4000 (closes #5363 )
2020-07-29 16:30:29 +03:00
- server: add logs for action handlers
2020-08-05 13:23:14 +03:00
- server: add request/response sizes in event triggers (and scheduled trigger) logs (#5463)
- server: change startup log kind `db_migrate` to `catalog_migrate` (#5531)
2020-07-31 13:17:52 +03:00
- console: handle nested fragments in allowed queries (close #5137 ) (#5252)
2020-07-30 23:54:20 +03:00
- console: update sidebar icons for different action and trigger types (#5445)
- console: make add column UX consistent with others (#5486)
2020-08-03 19:45:14 +03:00
- console: add "identity" to frequently used columns (close #4279 ) (#5360)
2020-08-10 08:24:00 +03:00
- cli: improve error messages thrown when metadata apply fails (#5513)
2020-08-10 08:58:03 +03:00
- cli: fix issue with creating seed migrations while using tables with capital letters (closes #5532 ) (#5549)
2020-08-06 18:48:55 +03:00
- build: introduce additional log kinds for cli-migrations image (#5529)
2020-07-20 18:08:00 +03:00
## `v1.3.0`
### Bug fixes and improvements
(Add entries here in the order of: server, console, cli, docs, others)
2020-07-14 22:00:58 +03:00
- server: adjustments to idle GC to try to free memory more eagerly (related to #3388 )
2020-07-10 19:47:05 +03:00
- server: process events generated by the event triggers asynchronously (close #5189 ) (#5352)
2020-07-09 14:58:25 +03:00
- console: display line number that error originated from in GraphQL editor (close #4849 ) (#4942)
2020-07-14 22:00:58 +03:00
- docs: add page on created_at / updated_at timestamps (close #2880 ) (#5223)
2020-07-04 07:45:37 +03:00
## `v1.3.0-beta.4`
### Bug fixes and improvements
(Add entries here in the order of: server, console, cli, docs, others)
2020-07-03 09:30:35 +03:00
- server: change relay endpoint to `/v1beta1/relay` (#5257)
- server: relay connection fields are exposed regardless of allow aggregation permission (fix #5218 ) (#5257)
2020-07-01 06:53:10 +03:00
- server: add new `--conn-lifetime` and `HASURA_GRAPHQL_PG_CONN_LIFETIME` options for expiring connections after some amount of active time (#5087)
- server: shrink libpq connection request/response buffers back to 1MB if they grow beyond 2MB, fixing leak-like behavior on active servers (#5087)
2020-07-05 05:53:19 +03:00
- server: have haskell runtime release blocks of memory back to the OS eagerly (related to #3388 )
2020-07-02 14:57:09 +03:00
- server: unlock locked scheduled events on graceful shutdown (#4928)
2020-07-01 15:14:19 +03:00
- server: disable prepared statements for mutations as we end up with single-use objects which result in excessive memory consumption for mutation heavy workloads (#5255)
2020-08-05 16:14:53 +03:00
- server: include scheduled event metadata (`created_at`,`scheduled_time`,`id`, etc) along with the configured payload in the request body to the webhook.
2020-10-30 17:52:55 +03:00
**WARNING:** This is breaking for beta versions as the payload is now inside a key called `payload` .
2020-07-01 23:06:24 +03:00
- console: allow configuring statement timeout on console RawSQL page (close #4998 ) (#5045)
2020-07-02 10:44:27 +03:00
- console: support tracking partitioned tables (close #5071 ) (#5258)
2020-07-02 11:27:53 +03:00
- console: add button to cancel one-off scheduled events and cron-trigger events (close #5161 ) (#5236)
2020-07-02 12:02:34 +03:00
- console: handle generated and identity columns in console data section (close #4552 , #4863 ) (#4761)
2020-07-03 07:19:09 +03:00
- cli: fix plugins install failing due to permission issues on windows (close #5111 )
2020-06-29 16:28:03 +03:00
- docs: add note for managed databases in postgres requirements (close #1677 , #3783 ) (#5228)
2020-07-01 16:23:40 +03:00
- docs: add 1-click deployment to Nhost page to the deployment guides (#5180)
2020-07-01 15:23:29 +03:00
- docs: add hasura cloud to getting started section (close #5206 ) (#5208)
2020-06-29 16:28:03 +03:00
## `v1.3.0-beta.3`
2020-06-17 16:55:51 +03:00
### Bug fixes and improvements
(Add entries here in the order of: server, console, cli, docs, others)
2020-06-23 13:05:54 +03:00
- server: fix introspection when multiple actions defined with Postgres scalar types (fix #5166 ) (#5173)
2020-06-18 13:43:19 +03:00
- console: allow manual edit of column types and handle array data types (close #2544 , #3335 , #2583 ) (#4546)
2020-06-19 12:06:40 +03:00
- console: add the ability to delete a role in permissions summary page (close #3353 ) (#4987)
2020-06-25 11:13:37 +03:00
- console: fix styling of table row contents on tables on relationship page (#4974)
2020-06-24 13:38:48 +03:00
- cli: handle missing files during metadata apply (close #5163 ) (#5170)
2020-07-08 00:47:42 +03:00
- docs: add pages on remote joins (close #4911 ) (#5132)
2020-07-01 18:44:21 +03:00
- docs: add page on scheduled triggers (close #4913 ) (#5141)
2020-06-23 23:08:41 +03:00
- docs: add page on Relay schema (close #4912 ) (#5150)
2020-06-17 16:55:51 +03:00
## `v1.3.0-beta.2`
### Bug fixes and improvements
(Add entries here in the order of: server, console, cli, docs, others)
2020-06-30 11:39:25 +03:00
- server: add `--pg-connection-options` command-line flag for passing parameters to PostgreSQL (close #5092 ) (#5187)
2020-06-24 03:35:36 +03:00
- server: improve memory usage of idle websockets connections (#5190)
2020-06-17 16:55:51 +03:00
- server: few relay fixes (fix #5020 , #5037 , #5046 ) (#5013)
- server: raise error on startup when `--unauthorized-role` is ignored (#4736)
- server: fix bug which arises when renaming/dropping a column on a remote relationship (#5005, #5119 )
- console: provide option to cascade metadata on dependency conflicts on console (fix #1593 )
- console: fix enum tables reload data button UI (#4647)
- console: fix "Cannot read property 'foldable'" runtime error in Browse Rows page (fix #4907 ) (#5016)
- console: respect read-only mode in actions pages (fix #4656 ) (#4764)
- console: allow configuring session_argument for custom functions (close #4499 ) (#4922)
- console: fix listen update column config selection for event trigger (close #5042 ) (#5043)
- cli: add new flags up-sql and down-sql to generate sql based migrations from the CLI (#5026)
2020-06-30 11:39:25 +03:00
- docs: add instructions on fixing loss of data when using floats (close #5092 )
2020-06-17 16:55:51 +03:00
- docs: add page on setting up v2 migrations (close #4746 ) (#4898)
## `v1.3.0-beta.1`
2020-06-08 15:13:01 +03:00
### Relay
2021-11-25 15:45:56 +03:00
The Hasura GraphQL Engine serves [Relay ](https://relay.dev/ ) schema for Postgres tables which has a primary key defined.
2020-06-08 15:13:01 +03:00
2020-07-03 09:30:35 +03:00
The Relay schema can be accessed through `/v1beta1/relay` endpoint.
2020-06-08 15:13:01 +03:00
[Add docs links][add console screenshot for relay toggle]
2020-05-27 18:02:58 +03:00
### Remote Joins
Remote Joins extend the concept of joining data across tables, to being able to join data across tables and remote schemas.
It works similar to table relationships. Head to the `Relationship` tab in your table page and define a remote relationship:
1. give a name for the relationship
2. select the remote schema
3. give the join configuration from table columns to remote schema fields.
2020-05-29 11:41:02 +03:00
[Add docs links][add console screenshot]
2020-05-27 18:02:58 +03:00
2020-05-13 15:33:16 +03:00
### Scheduled Triggers
A scheduled trigger can be used to execute custom business logic based on time. There are two types of timing events: cron based or timestamp based.
2020-05-29 11:41:02 +03:00
A cron trigger will be useful when something needs to be done periodically. For example, you can create a cron trigger to generate an end-of-day sales report every weekday at 9pm.
2020-05-13 15:33:16 +03:00
2020-05-20 09:16:26 +03:00
You can also schedule one-off events based on a timestamp. For example, a new scheduled event can be created for 2 weeks from when a user signs up to send them an email about their experience.
2020-05-13 15:33:16 +03:00
2020-05-29 11:41:02 +03:00
[Add docs links][add console screenshot]
2020-05-13 15:33:16 +03:00
(close #1914 )
2020-04-27 18:07:03 +03:00
### Allow access to session variables by computed fields (fix #3846)
Sometimes it is useful for computed fields to have access to the Hasura session variables directly. For example, suppose you want to fetch some articles but also get related user info, say `likedByMe` . Now, you can define a function like:
```
CREATE OR REPLACE FUNCTION article_liked(article_row article, hasura_session json)
RETURNS boolean AS $$
SELECT EXISTS (
SELECT 1
FROM liked_article A
WHERE A.user_id = hasura_session ->> 'x-hasura-user-id' AND A.article_id = article_row.id
);
$$ LANGUAGE sql STABLE;
```
2020-05-12 12:52:23 +03:00
2020-04-27 18:07:03 +03:00
and make a query like:
```
query {
articles {
title
content
likedByMe
}
2020-05-12 12:52:23 +03:00
}
2020-04-27 18:07:03 +03:00
```
Support for this is now added through the `add_computed_field` API.
2021-03-01 21:50:24 +03:00
Read more about the session argument for computed fields in the [docs ](https://hasura.io/docs/latest/graphql/core/api-reference/schema-metadata-api/computed-field.html ).
2020-04-27 18:07:03 +03:00
2020-06-16 15:15:04 +03:00
### Manage seed migrations as SQL files
2020-10-30 17:52:55 +03:00
2020-06-16 15:15:04 +03:00
A new `seeds` command is introduced in CLI, this will allow managing seed migrations as SQL files
#### Creating seed
2020-10-30 17:52:55 +03:00
2020-07-01 15:14:19 +03:00
```
2020-06-16 15:15:04 +03:00
# create a new seed file and use editor to add SQL content
hasura seed create new_table_seed
# create a new seed by exporting data from tables already present in the database
hasura seed create table1_seed --from-table table1
# create from data in multiple tables:
hasura seed create tables_seed --from-table table1 --from-table table2
```
2020-10-30 17:52:55 +03:00
2020-06-16 15:15:04 +03:00
#### Applying seed
2020-10-30 17:52:55 +03:00
2020-06-16 15:15:04 +03:00
```
# apply all seeds on the database:
hasura seed apply
# apply only a particular seed
hasura seed apply --file 1234_add_some_seed_data.sql
```
2020-04-29 09:26:19 +03:00
### Bug fixes and improvements
(Add entries here in the order of: server, console, cli, docs, others)
2020-05-29 11:41:02 +03:00
2020-05-21 18:50:25 +03:00
- server: fix explain queries with role permissions (fix #4816 )
2020-04-03 11:24:51 +03:00
- server: compile with GHC 8.10.1, closing a space leak with subscriptions. (close #4517 ) (#3388)
2020-05-18 15:27:56 +03:00
- server: fixes an issue where introspection queries with variables would fail because of caching (fix #4547 )
2020-05-13 13:10:46 +03:00
- server: avoid loss of precision when passing values in scientific notation (fix #4733 )
2020-05-13 11:09:44 +03:00
- server: fix mishandling of GeoJSON inputs in subscriptions (fix #3239 )
2020-05-20 09:16:26 +03:00
- server: fix importing of allow list query from metadata (fix #4687 )
2020-05-19 10:49:30 +03:00
- server: flush log buffer during shutdown (#4800)
2020-05-21 11:13:44 +03:00
- server: fix edge case with printing logs on startup failure (fix #4772 )
2020-05-29 12:10:02 +03:00
- console: allow entering big int values in the console (close #3667 ) (#4775)
2020-06-06 12:53:37 +03:00
- console: add support for subscriptions analyze in API explorer (close #2541 ) (#2541)
2020-05-06 21:07:56 +03:00
- console: avoid count queries for large tables (#4692)
2020-05-02 12:11:40 +03:00
- console: add read replica support section to pro popup (#4118)
2020-06-04 18:21:01 +03:00
- console: fix regression in editing permissions manually (fix #4683 ) (#4826)
2020-05-12 09:16:48 +03:00
- console: allow modifying default value for PK (fix #4075 ) (#4679)
2020-05-12 12:52:23 +03:00
- console: fix checkbox for forwarding client headers in actions (#4595)
2020-05-12 14:48:35 +03:00
- console: re-enable foreign tables to be listed as views (fix #4714 ) (#4742)
2020-05-14 13:05:00 +03:00
- console: display rows limit in permissions editor if set to zero (fix #4559 )
2020-05-14 16:25:57 +03:00
- console: fix inconsistency between selected rows state and displayed rows (fix #4654 ) (#4673)
2020-05-15 12:06:45 +03:00
- console: fix displaying boolean values in `Edit Row` tab (#4682)
2020-05-18 11:16:08 +03:00
- console: fix underscores not being displayed on raw sql page (close #4754 ) (#4799)
2020-05-29 11:41:02 +03:00
- console: fix visiting view modify page overwriting raw sql content (fix #4798 ) (#4810)
2020-05-27 19:13:04 +03:00
- console: add help button and move about page to settings (#4848)
2020-06-06 14:47:40 +03:00
- console: add new sidebar icon that separates enums from tables (fix #4984 ) (#4992)
2020-05-19 10:55:59 +03:00
- cli: list all available commands in root command help (fix #4623 ) (#4628)
2020-06-03 09:43:05 +03:00
- cli: fix bug with squashing event triggers (close #4883 )
2020-06-02 08:11:47 +03:00
- cli: add support for skipping execution while generating migrations through the migrate REST API
2020-06-03 14:19:36 +03:00
- cli: add dry run flag in hasura migrate apply command (fix #3128 ) (#3499)
- cli: load assets from server when HASURA_GRAPHQL_CONSOLE_ASSETS_DIR is set (close #3382 )
2020-05-11 16:12:58 +03:00
- docs: add section on actions vs. remote schemas to actions documentation (#4284)
2020-05-12 14:48:35 +03:00
- docs: fix wrong info about excluding scheme in CORS config (#4685)
2020-05-18 14:13:57 +03:00
- docs: add single object mutations docs (close #4622 ) (#4625)
2020-05-12 18:50:35 +03:00
- docs: add docs page on query performance (close #2316 ) (#3693)
2020-05-18 11:26:02 +03:00
- docs: add a sample Caddyfile for Caddy 2 in enable-https section (#4710)
2020-05-19 10:55:59 +03:00
- docs: add disabling dev mode to production checklist (#4715)
2020-05-22 11:04:41 +03:00
- docs: add integration guide for AWS Cognito (#4822, #4843 )
2020-05-21 12:38:38 +03:00
- docs: update troubleshooting section with reference on debugging errors (close #4052 ) (#4825)
2020-05-21 10:22:18 +03:00
- docs: add page for procuring custom docker images and binaries (#4828)
2020-05-21 20:27:11 +03:00
- docs: add content on how to secure action handlers and other actions docs improvements (#4743)
2020-06-06 13:12:14 +03:00
- docs: make header common with other hasura.io/ pages (#4957)
2020-06-03 12:55:47 +03:00
- install manifests: update all install manifests to enable dev mode by default (close #4599 ) (#4716)
2020-04-29 09:26:19 +03:00
## `v1.2.0`
Include the changelog from **v1.2.0-beta.1** , **v1.2.0-beta.2** , **v1.2.0-beta.3** , **v1.2.0-beta.4** , **v1.2.0-beta.5**
Additional changelog:
2020-04-28 14:59:57 +03:00
### CLI: Support servers with self-signed certificates (close #4564) (#4582)
A new flag `--certificate-authority` is added so that the CA certificate can be
provided to trust the Hasura Endpoint with a self-signed SSL certificate.
Another flag `--insecure-skip-tls-verification` is added to skip verifying the certificate
in case you don't have access to the CA certificate. As the name suggests,
using this flag is insecure since verification is not carried out.
2020-04-24 17:26:51 +03:00
### Bug fixes and improvements
2020-04-29 09:26:19 +03:00
- console: update graphiql explorer to support operation transform (#4567)
- console: make GraphiQL Explorer taking the whole viewport (#4553)
- console: fix table columns type comparision during column edit (close #4125 ) (#4393)
2020-04-26 20:05:39 +03:00
- cli: allow initialising project in current directory (fix #4560 ) #4566
2020-04-25 09:03:13 +03:00
- cli: remove irrelevant flags from init command (close #4508 ) (#4549)
2020-04-29 11:00:26 +03:00
- docs: update migrations docs with config v2 (#4586)
2020-04-29 10:46:02 +03:00
- docs: update actions docs (#4586)
2020-04-24 17:26:51 +03:00
## `v1.2.0-beta.5`
2020-04-24 12:10:53 +03:00
### server: backend only insert permissions
Introduces optional `backend_only` (default: `false` ) configuration in insert permissions
(see [api reference ](https://deploy-preview-4224--hasura-docs.netlify.com/graphql/manual/api-reference/schema-metadata-api/permission.html#insertpermission )).
If this is set to `true` , the insert mutation is accessible to the role only if the request
is accompanied by `x-hasura-use-backend-only-permissions` session variable whose value is set to `true` along with the `x-hasura-admin-secret` header.
Otherwise, the behavior of the permission remains unchanged.
This feature is highly useful in disabling `insert_table` mutation for a role from frontend clients while still being able to access it from a Action webhook handler (with the same role).
(rfc #4120 ) (#4224)
2020-04-24 10:55:51 +03:00
### server: debugging mode for non-admin roles
For any errors the server sends extra information in `extensions` field under `internal` key. Till now this was only
available for `admin` role requests. To enable this for other roles, start the server with `--dev-mode` flag or set `HASURA_GRAPHQL_DEV_MODE` env variable to `true` :
```bash
$ graphql-engine --database-url < database-url > serve --dev-mode
```
In case you want to disable `internal` field for `admin` role requests, set `--admin-internal-errors` option to `false` or or set `HASURA_GRAPHQL_ADMIN_INTERNAL_ERRORS` env variable to `false`
```bash
$ graphql-engine --database-url < database-url > serve --admin-internal-errors false
```
This feature come in handy during development when you may want to see detailed errors irrespective of roles.
**Improved internal errors for Actions**:
(This is a **breaking change** with previous 1.2.0-beta releases)
The `internal` field for action errors is improved with more debug information. It now includes `request` ,
`response` and `error` fields instead of just `webhook_response` field.
Before:
2020-05-12 12:52:23 +03:00
2020-04-24 10:55:51 +03:00
```json
{
"errors": [
{
"extensions": {
"internal": {
"webhook_response": {
"age": 25,
"name": "Alice",
"id": "some-id"
}
},
"path": "$",
"code": "unexpected"
},
"message": "unexpected fields in webhook response: age"
}
]
}
```
2020-05-12 12:52:23 +03:00
2020-04-24 10:55:51 +03:00
After:
2020-05-12 12:52:23 +03:00
2020-04-24 10:55:51 +03:00
```json
{
"errors": [
{
"extensions": {
"internal": {
"error": "unexpected response",
"response": {
"status": 200,
"body": {
"age": 25,
"name": "Alice",
"id": "some-id"
},
"headers": [
{
"value": "application/json",
"name": "Content-Type"
},
{
"value": "abcd",
"name": "Set-Cookie"
}
]
},
"request": {
"body": {
"session_variables": {
"x-hasura-role": "admin"
},
"input": {
"arg": {
"age": 25,
"name": "Alice",
"id": "some-id"
}
},
"action": {
"name": "mirror"
}
},
"url": "http://127.0.0.1:5593/mirror-action",
"headers": []
}
},
"path": "$",
"code": "unexpected"
},
"message": "unexpected fields in webhook response: age"
}
]
}
```
2020-04-23 05:47:51 +03:00
### cli: add support for .env file
ENV vars can now be read from .env file present at the project root directory. A global flag, `--envfile` , is added so you can explicitly provide the .env filename, which defaults to `.env` filename if no flag is provided.
**Example**:
```
hasura console --envfile production.env
```
2020-05-12 12:52:23 +03:00
2020-04-23 05:47:51 +03:00
The above command will read ENV vars from `production.env` file present at the project root directory.
(close #4129 ) (#4454)
2020-04-22 15:25:10 +03:00
### console: allow setting post-update check in update permissions
Along with the check for filtering rows that can be updated, you can now set a post-update permission check that needs to be satisfied by the updated rows after the update is made.
< add-screenshot >
(close #4142 ) (#4313)
2020-04-24 12:43:42 +03:00
### console: support for Postgres [materialized views](https://www.postgresql.org/docs/current/rules-materializedviews.html)
Postgres materialized views are views that are persisted in a table-like form. They are now supported in the Hasura Console, in the same way as views. They will appear on the 'Schema' page, under the 'Data' tab, in the 'Untracked tables or views' section.
(close #91 ) (#4270)
2020-04-24 10:55:51 +03:00
### docs: map Postgres operators to corresponding Hasura operators
2020-04-23 15:06:54 +03:00
Map Postgres operators to corresponding Hasura operators at various places in docs and link to PG documentation for reference.
2021-03-01 21:50:24 +03:00
For example, see [here ](https://hasura.io/docs/latest/graphql/core/api-reference/schema-metadata-api/syntax-defs.html#operator ).
2020-04-23 15:06:54 +03:00
(#4502) (close #4056 )
2020-04-21 09:36:30 +03:00
### Bug fixes and improvements
- server: add support for `_inc` on `real` , `double` , `numeric` and `money` (fix #3573 )
2020-04-21 11:06:11 +03:00
- server: support special characters in JSON path query argument with bracket `[]` notation, e.g `obj['Hello World!']` (#3890) (#4482)
2020-04-21 15:30:48 +03:00
- server: add graphql-engine support for timestamps without timezones (fix #1217 )
2020-04-21 16:56:15 +03:00
- server: support inserting unquoted bigint, and throw an error if value overflows the bounds of the integer type (fix #576 ) (fix #4368 )
2020-04-21 14:16:24 +03:00
- console: change react ace editor theme to eclipse (close #4437 )
- console: fix columns reordering for relationship tables in data browser (#4483)
2020-04-21 16:11:44 +03:00
- console: format row count in data browser for readablity (#4433)
- console: move pre-release notification tooltip msg to top (#4433)
- console: remove extra localPresets key present in migration files on permissions change (close #3976 ) (#4433)
- console: make nullable and unique labels for columns clickable in insert and modify (#4433)
- console: fix row delete for relationships in data browser (#4433)
2020-04-21 19:06:21 +03:00
- console: prevent trailing spaces while creating new role (close #3871 ) (#4497)
2020-04-21 11:34:39 +03:00
- docs: add API docs for using environment variables as webhook urls in event triggers
2020-04-24 12:43:42 +03:00
- server: fix recreating action's permissions (close #4377 )
2020-06-05 13:08:01 +03:00
- server: make the graceful shutdown logic customizable (graceful shutdown on the SIGTERM signal continues to be the default)
2020-04-23 08:57:45 +03:00
- docs: add reference docs for CLI (clsoe #4327 ) (#4408)
2020-04-21 09:36:30 +03:00
2020-04-16 14:09:01 +03:00
## `v1.2.0-beta.4`
2020-04-20 15:42:45 +03:00
### add query support in actions
2020-04-16 14:09:01 +03:00
(close #4032 ) (#4309)
2020-04-21 16:11:44 +03:00
### console: persist page state in data browser across navigation
2020-04-06 13:33:45 +03:00
2020-04-21 16:11:44 +03:00
The order, collapsed state of columns and rows limit is now persisted across page navigation
2020-04-06 13:33:45 +03:00
(close #3390 ) (#3753)
2020-04-01 12:55:28 +03:00
### Bug fixes and improvements
2020-04-13 13:21:53 +03:00
- cli: query support for actions (#4318)
2020-04-10 05:52:41 +03:00
- cli: add retry_conf in event trigger for squashing migrations (close #4296 ) (#4324)
2020-04-08 13:59:21 +03:00
- cli: allow customization of server api paths (close #4016 )
2020-04-08 08:24:47 +03:00
- cli: clean up migration files created during a failed migrate api (close #4312 ) (#4319)
2020-04-07 17:12:14 +03:00
- cli: add support for multiple versions of plugin (close #4105 )
2020-04-03 06:34:49 +03:00
- cli: template assets path in console HTML for unversioned builds
2020-04-21 16:11:44 +03:00
- cli: set_table_is_enum metadata type for squashing migrations (close #4394 ) (#4395)
- console: query support for actions (#4318)
2020-04-13 15:52:07 +03:00
- console: recover from SDL parse in actions type definition editor (fix #4385 ) (#4389)
2020-04-02 11:21:56 +03:00
- console: allow customising graphql field names for columns of views (close #3689 ) (#4255)
2020-04-03 12:09:03 +03:00
- console: fix clone permission migrations (close #3985 ) (#4277)
2020-04-07 14:17:13 +03:00
- console: decouple data rows and count fetch in data browser to account for really large tables (close #3793 ) (#4269)
2020-04-09 13:33:29 +03:00
- console: update cookie policy for API calls to "same-origin"
2020-04-13 17:22:32 +03:00
- console: redirect to /:table/browse from /:table (close #4330 ) (#4374)
2020-04-17 19:02:13 +03:00
- console: surround string type column default value with quotes (close #4371 ) (#4423)
2020-04-17 09:28:47 +03:00
- console: add undefined check to fix error (close #4444 ) (#4445)
2020-04-01 12:55:28 +03:00
- docs: add One-Click Render deployment guide (close #3683 ) (#4209)
2020-04-02 08:27:43 +03:00
- server: reserved keywords in column references break parser (fix #3597 ) #3927
2020-04-08 10:36:56 +03:00
- server: fix postgres specific error message that exposed database type on invalid query parameters (#4294)
2020-04-14 09:01:50 +03:00
- server: manage inflight events when HGE instance is gracefully shutdown (close #3548 )
2020-04-09 09:33:33 +03:00
- server: fix an edge case where some events wouldn't be processed because of internal erorrs (#4213)
2020-04-10 03:57:59 +03:00
- server: fix downgrade not working to version v1.1.1 (#4354)
2020-04-10 16:55:59 +03:00
- server: `type` field is not required if `jwk_url` is provided in JWT config
2020-04-16 09:45:21 +03:00
- server: add a new field `claims_namespace_path` which accepts a JSON Path for looking up hasura claim in the JWT token (#4349)
2020-04-16 14:09:01 +03:00
- server: support reusing Postgres scalars in custom types (close #4125 )
2020-04-21 16:56:15 +03:00
2020-03-31 16:44:09 +03:00
## `v1.2.0-beta.3`
2020-03-09 13:33:02 +03:00
2020-03-31 16:44:09 +03:00
### console: manage Postgres check constraints
2020-03-29 09:31:30 +03:00
Postgres Check constraints allows you to specify that the value in a certain column must satisfy a Boolean (truth-value) expression. They can be used to put in simple input validations for mutations and with this release, these constraints can now be added while creating a table or later from Modify tab on the console.
**Example**:
When a product is created, ensure that the price is greater than zero. The SQL would look like this:
2020-04-20 15:42:45 +03:00
2020-03-29 09:31:30 +03:00
```sql
CREATE TABLE products (
product_id UUID DEFAULT gen_random_uuid(),
name TEXT,
price NUMERIC CONSTRAINT positive_price CHECK (price > 0)
);
```
2020-04-20 15:42:45 +03:00
2020-03-29 09:31:30 +03:00
To create this table with Hasura Console, on the 'Add a new table' screen, after adding all the columns, scroll down to 'Check constraints' section and 'Add a new check constraint' with the following properties:
2020-04-20 15:42:45 +03:00
2020-03-29 09:31:30 +03:00
- Constraint name: `positive_price`
- Check expression: `price > 0`
Read more about check constraints on [Postgres Docs ](https://www.postgresql.org/docs/12/ddl-constraints.html#DDL-CONSTRAINTS-CHECK-CONSTRAINTS ).
(close #1700 ) (#3881)
2020-03-31 16:44:09 +03:00
### CLI: V2 migrations architecture
2020-04-20 15:42:45 +03:00
A new CLI migrations image is introduced to account for the new migrations workflow. If you're have a project with `version: 2` in `config.yaml` , you should use the new image: `hasura/graphql-engine:v1.2.0-cli-migrations-v2` . Mount the migrations at `/hasura-migrations` and metadata at `/hasura-metadata` .
2020-03-31 16:44:09 +03:00
2021-03-01 21:50:24 +03:00
See [upgrade docs ](https://hasura.io/docs/latest/graphql/core/migrations/upgrade-v2.html ).
2020-04-29 11:00:26 +03:00
2020-03-31 16:44:09 +03:00
(close #3969 ) (#4145)
### Bug fixes and improvements
2020-04-27 22:02:15 +03:00
2020-03-31 17:00:12 +03:00
- server: improve performance of replace_metadata tracking many tables (fix #3802 )
2020-03-31 16:44:09 +03:00
- server: option to reload remote schemas in 'reload_metadata' API (fix #3792 , #4117 )
- server: fix various space leaks to avoid excessive memory consumption
- server: fix postgres query error when computed fields included in mutation response (fix #4035 )
- server: fix `__typename` not being included for custom object types (fix #4063 )
- server: preserve cookie headers from sync action webhook (close #4021 )
- server: validate action webhook response to conform to action output type (fix #3977 )
- server: add 'ID' to default scalars in custom types (fix #4061 )
2020-04-08 18:59:46 +03:00
- server: fix erroneous error log "Received STOP for an operation ..."
2020-03-31 16:44:09 +03:00
- console: enum field values can be selected through a dropdown in insert/edit rows page (close #3748 ) (#3810)
- console: exported metadata filenames are now unique(`hasura_metadata_< timestamp > .json`) (close #1772 ) (#4106)
- console: allow bulk deleting rows in 'Browse Rows' section (close #1739 ) (#3735)
- console: fix computed field permission selection (#4246)
- console: allow customising root fields of single row mutations (close #4203 ) (#4254)
- console: fix json string rendering in data browser (close #4201 ) (#4221)
- console: handle long column names in event trigger update columns (close #4123 ) (#4210)
- console: disable selecting roles without permissions for bulk actions (close #4178 ) (#4195)
- console: fix passing default value to JsonInput (#4175)
- console: fix parsing of wrapped types in SDL (close #4099 ) (#4167)
- console: misc actions fixes (#4059)
- console: action relationship page improvements (fix #4062 , #4130 ) (#4133)
2020-07-02 00:16:09 +03:00
- console: add code exporter to graphiql (close #4531 ) #4652
2020-03-31 16:44:09 +03:00
- cli: fix init command to generate correct config (fix #4036 ) (#4038)
- cli: fix parse error returned on console api (close #4126 ) (#4152)
- cli: fix typo in cli example for squash (fix #4047 ) (#4049)
- docs: add statement to grant hasura permissions for PG functions (#4238)
- docs: add docs for redeliver_event api (fix #4176 ) (#4177)
- docs: update permission.rst for check constraint api (#4124)
- docs: add note on pg versions for actions (#4034)
- docs: add latest prerelease build info (close #4041 ) (#4048)
- docs: add AuthGuardian JWT guide (#3958)
## `v1.2.0-beta.2`
- server: Don't update catalog version if using --dryRun (#3970)
- cli: add version flag in update-cli command (#3996)
- cli(migrations-img): add env to skip update prompts (fix #3964 ) (#3968)
- cli, server: use prerelease tag as channel for console assets cdn (#3975)
- cli: fix flags in actions, migrate and metadata cmd (fix #3982 ) (#3991)
- cli: preserve action definition in metadata apply (fix… (#3993)
- cli: bug fixes related to actions (#3951)
## `v1.2.0-beta.1`
### Hasura Actions
Actions are a way to extend Hasura’ s auto-generated mutations with entirely custom ones which can handle various use cases such as data validation, data enrichment from external sources and any other complex business logic.
A new mutation can be created either by defining its GraphQL SDL or by deriving it from an existing Hasura-generated mutation. The resolver is exposed to Hasura as a webhook which can be called synchronously or asynchronously. This release also includes an ever evolving codegen workflow to make managing the custom resolvers easier.
Read more about actions in the [docs ](https://docs.hasura.io/1.0/graphql/manual/actions/index.html ).
(#3042) (#3252) (#3859)
2020-03-29 09:31:30 +03:00
### Downgrade command
A new command is added to the server executable for downgrading to earlier releases. Previously, if you ran a newer Hasura version and wanted to go back to an old version on the same database, you had to stop Hasura, run some SQL statements and start Hasura again. With the new `downgrade` command, these SQL statements can be run automatically.
**Example**: Downgrade from `v1.2.0` to `v1.0.0` :
2020-04-20 15:42:45 +03:00
2020-03-29 09:31:30 +03:00
```bash
# stop hasura v1.2.0
# run the following command:
docker run hasura/graphql-engine:v1.2.0 graphql-engine --database-url < db-url > downgrade --to-v1.0.0
# start hasura v1.0.0
```
2021-03-01 21:50:24 +03:00
Read more about this command in the [docs ](https://hasura.io/docs/latest/graphql/core/deployment/downgrading.html#downgrading-hasura-graphql-engine ).
2020-03-29 09:31:30 +03:00
(close #1156 ) (#3760)
2020-04-03 03:00:13 +03:00
### Expiration of connections authenticated by WebHooks
When using webhooks to authenticate incoming requests to the GraphQL engine server, it is now possible to specify an expiration time; the connection to the server will be automatically closed if it's still running when the expiration delay is expired.
2021-03-01 21:50:24 +03:00
Read more about it in the [docs ](https://hasura.io/docs/latest/graphql/core/auth/authentication/webhook.html ).
2020-04-03 03:00:13 +03:00
2020-03-31 16:44:09 +03:00
### Bug fixes and improvements
2020-04-20 15:42:45 +03:00
2020-03-31 16:44:09 +03:00
- 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)
2020-04-27 22:02:15 +03:00
- docs: add page on data validation to docs (close #4085 ) (#4260)