这是indexloc提供的服务,不要输入任何密码
Skip to content

Releases: hasura/graphql-engine

v1.3.1-beta.1

12 Aug 12:00

Choose a tag to compare

v1.3.1-beta.1 Pre-release
Pre-release

Changelog

This is a beta release for v1.3.1. This fixes few bugs and includes general refactors.

Breaking change

Headers from environment variables starting with HASURA_GRAPHQL_ are not allowed in event triggers, actions & remote schemas.

If you do have such headers configured, then you must update the header configuration before upgrading.

Bug fixes and improvements

  • server: fix failing introspection query when an enum column is part of a primary key (fixes #5200)
  • server: disallow headers from env variables starting with HASURA_GRAPHQL_ in event triggers, actions & remote schemas (#5519)
    WARNING: This might break certain deployments. See Breaking change section above.
  • server: bugfix to allow HASURA_GRAPHQL_QUERY_PLAN_CACHE_SIZE of 0 (#5363)
  • server: support only a bounded plan cache, with a default size of 4000 (closes #5363)
  • server: add logs for action handlers (#5471)
  • server: add request/response sizes in event triggers (and scheduled trigger) logs (#5463)
  • server: change startup log kind db_migrate to catalog_migrate (#5531)
  • console: handle nested fragments in allowed queries (close #5137) (#5252)
  • console: update sidebar icons for different action and trigger types (#5445)
  • console: make add column UX consistent with others (#5486)
  • cli: improve error messages thrown when metadata apply fails (#5513)
  • cli: fix issue with creating seed migrations while using tables with capital letters (closes #5532) (#5549)
  • build: introduce additional log kinds for cli-migrations image (#5529)

Using this release

Use the following docker image:

hasura/graphql-engine:v1.3.1-beta.1

v1.3.0

20 Jul 12:09

Choose a tag to compare

Changelog

New features and highlights

Remote Joins

Remote Joins generalizes the concept of joining data between tables in Postgres, to being able to join data across any part of your GraphQL schema. The schema's underlying source can be anything: Postgres or REST APIs (via Actions) or other GraphQL services (via Remote Schemas), but you can still do a join across them by simply creating relationships via Hasura metadata.

Remote Joins enables complete data federation as your data sources can evolve independently while Hasura provides a unified GraphQL API over them with authorization and schema integrity enabled from get-go.

In this release, you can create relationships from tables to Remote Schemas. This works similar to table relationships. Head to the Relationship tab in your table page and define a Remote Relationship:

  • give a name for the relationship
  • select the remote schema
  • give the join configuration from table columns to remote schema fields.

remote-relationships

The join configuration can refer to any field in the remote schema that takes an input argument. It can also take static values.

remote-rel-configuration

Once this is done, head to GraphiQL and make your query with the remote relationship! Note: Action relationships are kind of a reverse join of this where you can create a relationship from your REST API to a table.

(#2392)

Relay

The Hasura GraphQL Engine now serves a Relay schema for Postgres tables which have a primary key defined. Relay allows you to combine React and GraphQL to build highly modular and performant javascript applications.

The Relay schema can be accessed through /v1beta1/relay endpoint.

relay

(#4458)

Scheduled Triggers

Scheduled Triggers can be used to invoke webhooks based on a cron schedule or timestamp. Head to the Events page on the console and check it out.

A Cron Trigger can be used to invoke webhooks on a fixed schedule. For example, you can create a Cron Trigger to generate an end-of-day sales report every weekday at 10 pm.

Selection_355

You can also schedule one-off events based on a timestamp. For example, a scheduled event can be created to send a feedback email to a user 2 days after sign-up (note: this would typically be done using the metadata API in your code).

Selection_356

(#3553, #4732)

Allow access to session variables in computed fields

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;

and make a query like:

query {
  articles {
    title
    content
    likedByMe
  }
}

Support for this is now added through the add_computed_field API.

Read more about the session argument for computed fields in the docs.

(fix #3846)

Manage seed migrations as SQL files

A new seeds command is introduced in CLI, this will allow managing seed migrations as SQL files

Creating seed

# create a new seed file and use editor to add SQL content
hasura seeds create new_table_seed

# create a new seed by exporting data from tables already present in the database
hasura seeds create table1_seed --from-table table1

# create from data in multiple tables:
hasura seeds create tables_seed --from-table table1 --from-table table2

Applying seed

# apply all seeds on the database:
hasura seeds apply

# apply only a particular seed
hasura seeds apply --file 1234_add_some_seed_data.sql

Other fixes and improvements

  • server: flush log buffer during shutdown (#4800)
  • server: raise error on startup when --unauthorized-role is ignored (#4736)
  • 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)
  • server: add --pg-connection-options command-line flag for passing parameters to PostgreSQL (close #5092) (#5187)
  • server: adjustments to idle GC to try to free memory more eagerly (related to #3388)
  • console: allow entering big int values in the console (close #3667) (#4775)
  • console: add support for subscriptions analyze in API explorer (close #2541) (#2541)
  • console: avoid count queries for large tables (#4692)
  • console: fix regression in editing permissions manually (fix #4683) (#4826)
  • console: allow modifying default value for PK (fix #4075) (#4679)
  • console: fix checkbox for forwarding client headers in actions (#4595)
  • console: re-enable foreign tables to be listed as views (fix #4714) (#4742)
  • console: display rows limit in permissions editor if set to zero (fix #4559)
  • console: fix inconsistency between selected rows state and displayed rows (fix #4654) (#4673)
  • console: fix displaying boolean values in Edit Row tab (#4682)
  • console: fix underscores not being displayed on raw sql page (close #4754) (#4799)
  • console: fix visiting view modify page overwriting raw sql content (fix #4798) (#4810)
  • console: add new sidebar icon that separates enums from tables (fix #4984) (#4992)
  • 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: allow manual edit of column types and handle array data types (close #2544, #3335, #2583) (#4546)
  • console: add the ability to delete a role in permissions summary page (close #3353) (#4987)
  • console: fix styling of table row contents on tables on relationship page (#4974)
  • console: allow configuring statement timeout on console RawSQL page (close #4998) (#5045)
  • console: support tracking partitioned tables (close #5071) (#5258)
  • console: handle generated and identity columns in console data section (close #4552, #4863) (#4761)
  • console: display line number that error originated from in GraphQL editor (close #4849) (#4942)
  • cli: list all available commands in root command help (fix #4623) (#4446
  • cli: fix bug with squashing event triggers (close #4883)
  • cli: add support for skipping execution while generating migrations through the migrate REST API
  • 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)
  • cli: add new flags up-sql and down-sql to generate sql based migrations from the CLI (#5026)
  • cli: handle missing files during metadata apply (close #5163) (#5170)
  • cli: fix plugins install failing due to permission issues on windows (close #5111)
  • docs: add section on actions vs. remote schemas to actions documentation (#4284)
  • docs: fix wrong info about excluding scheme in CORS config (#4685)
  • docs: add single object mutations docs (close #4622) (#4625)
  • docs: add docs page on query performance (close #2316) (#3693)
  • docs: add a sample Caddyfile for Caddy 2 in enable-https section (#4710)
  • docs: add disabling dev mode to production checklist (#4715)
  • docs: add integration guide for AWS Cognito (#4822, #4843)
  • docs: update troubleshooting section with reference on debugging errors (close #4052) (#4825)
  • docs: add page for procuring custom docker images and binaries (#4828)
  • docs: add content on how to secure action handlers and other actions docs improvements (#4743)
  • docs: make header common with other hasura.io/ pages (#4957)
  • docs: add page on setting up v2 migrations (close #4746) (#4898)
  • docs: add note for managed databases in postgres requirements (close #1677, #3783) (#5228)
  • docs: add 1-click deployment to Nhost page to the deployment guides (#5180)
  • docs: add hasura cloud to getting started section (close #5206) (#5208)
  • docs: add page on created_at / updated_at timestamps (close #2880) (#5223)
  • install manifests: update all install manifests to enable dev mode by default (close #4599) (#4716)

Using this release

Use the following docker image:

hasura/graphql-engine:v1.3.0

v1.3.0-beta.4

03 Jul 09:01

Choose a tag to compare

v1.3.0-beta.4 Pre-release
Pre-release

Changelog

  • server: change relay endpoint to /v1beta1/relay (#5257)
  • server: relay connection fields are exposed regardless of allow aggregation permission (fix #5218) (#5257)
  • 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)
  • server: unlock locked scheduled events on graceful shutdown (#4928)
  • 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)
  • server: include scheduled event metadata (created_at,scheduled_time,id, etc) along with the configured payload in the request body to the webhook. (fix #5253) (#5262)
    WARNING: This is breaking for previous beta versions as the payload is now inside a key called payload.
  • server: add --pg-connection-options command-line flag for passing parameters to PostgreSQL (close #5092) (#5187)
  • console: allow configuring statement timeout on console RawSQL page (close #4998) (#5045)
  • console: support tracking partitioned tables (close #5071) (#5258)
  • console: add button to cancel one-off scheduled events and cron-trigger events (close #5161) (#5236)
  • console: handle generated and identity columns in console data section (close #4552, #4863) (#4761)
  • cli: fix plugins install failing due to permission issues on windows (close #5111)
  • docs: add note for managed databases in postgres requirements (close #1677, #3783) (#5228)
  • docs: add 1-click deployment to Nhost page to the deployment guides (#5180)
  • docs: add hasura cloud to getting started section (close #5206) (#5208)

Using this release

Use the following docker image:

hasura/graphql-engine:v1.3.0-beta.4

v1.3.0-beta.3

25 Jun 08:37

Choose a tag to compare

v1.3.0-beta.3 Pre-release
Pre-release

This is the third beta for v1.3. This fixes reported bugs in previous betas and few other additions.

Changelog

server: fix postgres error when querying object relationship in fields and with order_by clause (fix #5148) (#5177)
server: fix relay introspection when remote relationships are defined (fix #5144) (#5145)
server: fix introspection when multiple actions defined with Postgres scalar types (fix #5166) (#5173)
console: allow manual edit of column types and handle array data types (close #2544, #3335, #2583) (#4546)
console: add the ability to delete a role in permissions summary page (close #3353) (#4987)
console: fix styling of table row contents on tables on relationship page (#4974)
cli: handle missing files during metadata apply (close #5163) (#5170)
docs: add page on Relay schema (close #4912) (#5150)

Using this release

Use the following docker image:

hasura/graphql-engine:v1.3.0-beta.3

v1.3.0-beta.2

17 Jun 10:39

Choose a tag to compare

v1.3.0-beta.2 Pre-release
Pre-release

This is the second beta for v1.3. This fixes reported bugs in v1.3.0-beta.1 and few other additions.

Changelog

Manage seed migrations as SQL files

A new seeds command is introduced in CLI, this will allow managing seed migrations as SQL files

Creating seed

# create a new seed file and use editor to add SQL content
hasura seeds create new_table_seed

# create a new seed by exporting data from tables already present in the database
hasura seeds create table1_seed --from-table table1

# create from data in multiple tables:
hasura seeds create tables_seed --from-table table1 --from-table table2

Applying seed

# apply all seeds on the database:
hasura seeds apply

# apply only a particular seed
hasura seeds apply --file 1234_add_some_seed_data.sql

Other changes

  • 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)
  • docs: add page on setting up v2 migrations (close #4746) (#4898)

Using this release

Use the following docker image:

hasura/graphql-engine:v1.3.0-beta.2

v1.3.0-beta.1

08 Jun 14:05

Choose a tag to compare

v1.3.0-beta.1 Pre-release
Pre-release

Changelog

This is the first beta for v1.3. The highlights of this release are:

Data federation via Remote Joins

Remote Joins extends the concept of joining data across tables, to being able to join data across any compatible data source. This enables complete data federation as your sources can evolve independently while Hasura does the join, authorization and checks consistency of the unified schema.

In this release, you can create relationships from tables to remote schemas. This works similar to table relationships. Head to the Relationship tab in your table page and define a remote relationship:

  • give a name for the relationship
  • select the remote schema
  • give the join configuration from table columns to remote schema fields.

remote-relationships

The join configuration can refer to any field in the remote schema that takes an input argument and it can also take static values.

remote-rel-configuration

Once this is done, head to GraphiQL and make your query with the remote relationship! Note: Action relationships are kind of a reverse join of this where you can create a relationship from your action type to a table.

(#2392)

Relay

The Hasura GraphQL Engine now serves a Relay schema for Postgres tables which have a primary key defined.

The Relay schema can be accessed through /v1/relay endpoint.

relay

(#4458)

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. Head to the Events page on the console and check it out.

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 10 pm.

Selection_355

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 a reminder email (note: this would perhaps be done using the metadata API in your code).

Selection_356

(#3553, #4732)

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;

and make a query like:

query {
  articles {
    title
    content
    likedByMe
  }
}

Support for this is now added through the add_computed_field API.

Read more about the session argument for computed fields in the docs.

Bug fixes and improvements

  • server: fix explain queries with role permissions (fix #4816)
  • server: compile with GHC 8.10.1, closing a space leak with subscriptions. (close #4517) (#3388)
  • server: fixes an issue where introspection queries with variables would fail because of caching (fix #4547)
  • server: avoid loss of precision when passing values in scientific notation (fix #4733)
  • server: fix mishandling of GeoJSON inputs in subscriptions (fix #3239)
  • server: fix importing of allow list query from metadata (fix #4687)
  • server: flush log buffer during shutdown (#4800)
  • server: fix edge case with printing logs on startup failure (fix #4772)
  • console: allow entering big int values in the console (close #3667) (#4775)
  • console: add support for subscriptions analyze in API explorer (close #2541) (#2541)
  • console: avoid count queries for large tables (#4692)
  • console: add read replica support section to pro popup (#4118)
  • console: fix regression in editing permissions manually (fix #4683) (#4826)
  • console: allow modifying default value for PK (fix #4075) (#4679)
  • console: fix checkbox for forwarding client headers in actions (#4595)
  • console: re-enable foreign tables to be listed as views (fix #4714) (#4742)
  • console: display rows limit in permissions editor if set to zero (fix #4559)
  • console: fix inconsistency between selected rows state and displayed rows (fix #4654) (#4673)
  • console: fix displaying boolean values in Edit Row tab (#4682)
  • console: fix underscores not being displayed on raw sql page (close #4754) (#4799)
  • console: fix visiting view modify page overwriting raw sql content (fix #4798) (#4810)
  • console: add help button and move about page to settings (#4848)
  • console: add new sidebar icon that separates enums from tables (fix #4984) (#4992)
  • cli: list all available commands in root command help (fix #4623) (#4628)
  • cli: fix bug with squashing event triggers (close #4883)
  • cli: add support for skipping execution while generating migrations through the migrate REST API
  • 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)
  • docs: add section on actions vs. remote schemas to actions documentation (#4284)
  • docs: fix wrong info about excluding scheme in CORS config (#4685)
  • docs: add single object mutations docs (close #4622) (#4625)
  • docs: add docs page on query performance (close #2316) (#3693)
  • docs: add a sample Caddyfile for Caddy 2 in enable-https section (#4710)
  • docs: add disabling dev mode to production checklist (#4715)
  • docs: add integration guide for AWS Cognito (#4822, #4843)
  • docs: update troubleshooting section with reference on debugging errors (close #4052) (#4825)
  • docs: add page for procuring custom docker images and binaries (#4828)
  • docs: add content on how to secure action handlers and other actions docs improvements (#4743)
  • docs: make header common with other hasura.io/ pages (#4957)
  • install manifests: update all install manifests to enable dev mode by default (close #4599) (#4716)

Using this release

Use the following docker image:

hasura/graphql-engine:v1.3.0-beta.1

v1.2.2

01 Jun 12:14

Choose a tag to compare

Changelog

This is the second patch release for v1.2. Includes mainly server fixes.

server: fix explain queries with role permissions (fix #4816) (ee0602e)
server: compile with GHC 8.10.1, closing a space leak with subscriptions (close #4517) (#3388)
server: websockets will rethrow ResourceVanished as ConnectionClosed (close #4344) (a77bb05)
server: fix introspection queries with variables failure because of caching (fix #4547) (#4661)
server: avoid loss of precision when passing values in scientific notation (fix #4733) (#4741)
server: fix mishandling of GeoJSON inputs in subscriptions (fix #3239) (#4551)
server: fix importing of allow list query from metadata (fix #4687) (#4762)
server: fix edge case with printing logs on startup failure (fix #4772) (#4801)
console: add Help button and move About page to settings (#4848)
cli: fix update scripts failing when sql migrations files are already present (#4882)

Using this release

Use the following docker image:

hasura/graphql-engine:v1.2.2

CLI

Download the binary:

Using existing CLI:

hasura update-cli

Urgent security patch for 1.2

05 May 23:44

Choose a tag to compare

🚨 🚨 Urgent security patch for 1.2.0 🚨 🚨

If you’re on v1.2.0-beta.5 or v1.2.0, please upgrade to v1.2.1 immediately since you may be impacted. Please reach out to us at support@hasura.io or on our website chat if you have any questions and need help.

Security advisory and details published here: GHSA-j622-hw7j-c72x

v1.2.0

29 Apr 07:43

Choose a tag to compare

Changelog

Highlights

Introducing Hasura Actions

Actions are a way to extend Hasura’s auto-generated schema with user-defined queries and mutations. These custom queries and mutations are backed by REST APIs in which you can perform any kind of business logic.

A new Action can be created by defining it in GraphQL SDL in Console or CLI:

action-create-page

An Action can also be derived from an existing query or mutation:

actions-derive-button

And, you can get some codegen for Action handlers as well:

console-codegen-tab

That is not all! You can also create relationships with the rest of the graph and put Actions under Hasura's role-based permission system as well.

Read more about Actions in the docs.

(#3042) (#3252) (#3859)

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.

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.

Screenshot 2020-04-24 at 14 05 54

(close #384) (rfc #3750) (#3804) (close #4142) (#4313)

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).

(rfc #4120) (#4224)

Support for more operators and postgres features:

  • add support for _inc on real, double, numeric and money (#3573)
  • add support special characters in JSON path query argument e.g obj['Hello World!'] (#3890) (#4482)
  • add support for timestamps without timezones (fix #1217)
  • Postgres materialized views can be added from the console ( #91) (#4270)

Downgrade command

A new command is added to the server 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:

# 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.1.0

# start hasura v1.1.0

Read more about this command in the docs.

(close #1156) (#3760)

New migrations workflow: Config v2

A new workflow for managing migrations and metadata is introduced. In this workflow, called config v2, migrations are pure SQL files and metadata is a collection of declarative files. Read more about this workflow in the docs.

To see what has changed from previous (i.e. config v1) workflow, read this.

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.

The config v2 workflow has an order of magnitude better performance than config v1 as the metadata is built only once as opposed to for every migration in config v1. As a result, adding 1000 tables now takes about ~10 seconds as opposed to multiple minutes with config v1.

Support for .env file in CLI

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.

(close #4129) (#4454)

Support servers with self-signed certificates in CLI

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.

(close #4564) (#4582)

Docs on performing data validations

A new page in docs is added to illustrate the various ways of performing data validations with Hasura. Read it here.

(close #4085) (#4260 )

Other features, bug fixes and improvements

  • server: Don't update catalog version if using --dryRun (#3970)
  • server, cli: use prerelease tag as channel for console assets cdn (#3927)
  • server: improve performance of replace_metadata tracking many tables (fix #3802)
  • server: option to reload remote schemas in 'reload_metadata' API (fix #3792, #4117)
  • server: fix various space leaks to avoid excessive memory consumption
  • server: event triggers refactor with backpressure. HASURA_GRAPHQL_EVENTS_FETCH_INTERVAL changes semantics slightly (close #3839)
  • server: fix postgres query error when computed fields included in mutation response (fix #4035)
  • server: preserve cookie headers from sync action webhook (close #4021)
  • server: support reusing Postgres scalars in Actions
  • server: accept a new argument "claims_namespace_path" in JWT config
  • server: fix bug with reserved keywords in column references (fix #3597) #3927
  • server: fix postgres specific error message that exposed database type on invalid query parameters (#4294)
  • server: manage inflight events when HGE instance is gracefully shutdown (close #3548)
  • server: fix an edge case where some events wouldn't be processed because of internal erorrs (#4213)
  • server: type field is not required if jwk_url is provided in JWT config
  • server: support inserting unquoted bigint, and throw an error if value overflows the bounds of the integer type (fix #576) (fix #4368)
  • server: add support for webhook auth connection expiration in websockets (close #3867) (#4196)
  • console: show pre-release update notifications with opt out option (#3888)
  • console: handle invalid keys in permission builder (close #3848) (#3863)
  • 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)
  • console: manage Postgres check constraints from Create Table page
  • console: persist page state in data browser across navigation
  • console: allow customising graphql field names for columns of views
  • console: fix clone permission migrations (close #3985) (#4277)
  • console: decouple data rows and count fetch in data browser to account for really large tables (close #379...
Read more

v1.2.0-beta.5

24 Apr 10:48

Choose a tag to compare

v1.2.0-beta.5 Pre-release
Pre-release

Changelog

(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).

(rfc #4120) (#4224)

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!']

(#3890) (#4482)

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.

Screenshot 2020-04-24 at 14 05 54

(close #4142) (#4313)

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.

(close #91) (#4270)

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.

(close #4129) (#4454)

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.

(#4502) (close #4056)

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