Skip to content

@hasura-bot hasura-bot released this Sep 7, 2020 · 174 commits to master since this release

Changelog

We’ve fixed an issue where the column masking in select permissions were not applied for scalar computed fields (#5696). This issue affects you only if you’re using scalar valued computed fields and if you’re not using allow-lists.

We recommend you upgrade to v1.3.2 if you’re using v1.3.0 or v1.3.1

Using this release

Use the following docker image:

hasura/graphql-engine:v1.3.2
Assets 8

@hasura-bot hasura-bot released this Aug 21, 2020 · 174 commits to master since this release

Changelog

This is the first patch release for v1.3. 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 upper-case 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
Assets 8
Pre-release
Pre-release

@hasura-bot hasura-bot released this Aug 12, 2020 · 174 commits to master since this 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
Assets 8

@hasura-bot hasura-bot released this Jul 20, 2020 · 252 commits to master since this release

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
Assets 8
Pre-release
Pre-release

@hasura-bot hasura-bot released this Jul 3, 2020 · 279 commits to master since this 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
Assets 8
Pre-release
Pre-release

@hasura-bot hasura-bot released this Jun 25, 2020 · 313 commits to master since this 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
Assets 8
Pre-release
Pre-release

@hasura-bot hasura-bot released this Jun 17, 2020 · 344 commits to master since this 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
Assets 8
Pre-release
Pre-release

@hasura-bot hasura-bot released this Jun 8, 2020 · 405 commits to master since this 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
Assets 8

@hasura-bot hasura-bot released this Jun 1, 2020 · 564 commits to master since this release

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
Assets 8

@shahidhk shahidhk released this May 5, 2020 · 564 commits to master since this release

🚨 🚨 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

Assets 8
You can’t perform that action at this time.