v1.2.0-beta.5
Pre-releaseChangelog
(This is the final beta release for v1.2)
Highlights
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
:
$ 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
$ 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 small 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:
{
"errors": [
{
"extensions": {
"internal": {
"webhook_response": {
"age": 25,
"name": "Alice",
"id": "some-id"
}
},
"path": "$",
"code": "unexpected"
},
"message": "unexpected fields in webhook response: age"
}
]
}
After:
{
"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"
}
]
}
server: backend only insert permissions
Introduces optional backend_only
(default: false
) configuration in insert permissions. See api reference.
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 useful for disabling insert_table
mutation for frontend clients (for a role) while still being able to access it from a Action webhook handler (with the same role).
server: add support for _inc
on real
, double
, numeric
and money
(fix #3573)
server: support special characters in JSON path query argument
The path
argument in json/jsonb fields can accept bracket []
notation, e.g obj['Hello World!']
server: add support for timestamps without timezones
(fix #1217)
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. Read more in the RFC.
console: support for Postgres materialized views
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.
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
The above command will read ENV vars from production.env
file present at the project root directory.
docs: map Hasura operators to corresponding Postgres operators
Document the mapping of Hasura operators to corresponding Postgres operators at various places in docs and link to Postgres documentation for reference. For example, see this.
Bug fixes and improvements
- server: support inserting unquoted bigint, and throw an error if value overflows the bounds of the integer type (fix #576) (fix #4368)
- server: fix bug with recreating action's permissions (close #4377)
- console: change react ace editor theme to eclipse (close #4437)
- console: fix columns reordering for relationship tables in data browser (#4483)
- 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)
- console: prevent trailing spaces while creating new role (close #3871) (#4497)
- docs: add API docs for using environment variables as webhook urls in event triggers (#4462)
- docs: add configuration reference docs for CLI (close #4327) (#4408)
Using this release
Use the following docker image:
hasura/graphql-engine:v1.2.0-beta.5
CLI
Download the binary:
Using existing CLI ( since v1.2.0-beta.2
):
hasura update-cli --version v1.2.0-beta.5