Hasura v2.2.0 Release Notes

  • Nested Action Types

    ๐Ÿ‘ Actions now support nested responses as described by associated action types.Example:

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

    ๐Ÿ’ฅ Breaking Changes

    • For any MSSQL backend, count aggregate query on multiple columns is restricted with a GraphQL schema change as follows
    count (
    ---  columns: [table_select_column!]
    +++  column: table_select_column
      distinct: Boolean
    ): Int!
    

    MSSQL doesn't support applying COUNT() on multiple columns.

    ๐Ÿ› 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: add a placeholder field to the schema when the query_root would be empty
    • server: fix invalid GraphQL name in the schema arising from a remote relationship from a table in a custom schema
    • server: add a new metadata API get_cron_triggers to fetch all the cron triggers
    • server: add response transforms for actions, events, and triggers
    • server: bigquery: implement distinct_on.
    • โš™ server: extend transactions to MSSQL GraphQL queries and mssql_run_sql /v2/query API
    • server: improve error messages in MSSQL database query exceptions
    • โช server: in mssql transactions, rollback only if the transaction is active
    • server: add request and response bodies to OpenAPI specification of REST endpoints
    • server: implement upsert mutations for MS SQL Server (close #7864)
    • ๐Ÿ‘ server: extend support for insert mutations to tables without primary key constraint in a MSSQL backend
    • ๐Ÿ“œ server: fix parsing FLOAT64s in scientific notation and non-finite ones in BigQuery
    • ๐Ÿ‘ server: extend support for the min/max aggregates to all comparable types in BigQuery
    • ๐Ÿ‘ server: fix support for joins in aggregates nodes in BigQuery
    • server: extend allowlist metadata with scope information, new command update_scope_of_allowlist_in_metadata
    • server: fix for passing input objects in query variables to remote schemas with type name customization (#7977)
    • server: fix REST endpoints with path segments not showing correctly in the OpenAPI spec
    • server: fix aliases used in GraphQL queries in REST endpoints not being reflected in the OpenAPI spec
    • server: refresh JWKs a maximum of once per second (fix #5781)
    • โšก๏ธ server: implement update mutations for MS SQL Server (closes #7834)
    • ๐Ÿ‘ server: support nested output object types in actions (#4796)
    • server: action webhook requests now include a User-Agent header (fix #8070)
    • server: postgres: return a single entry per row (selected randomly) when an object relationship is misconfigured one-to-many (fix #7936).
    • 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)
    • console: fix custom field names breaking browse table sorting and the pre-populating of the edit row form
    • ๐Ÿ‘ console: enable support for insert & delete permissions for mssql tables
    • console: enable inherited role on settings page
    • ๐Ÿ‘€ 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.
    • cli: fix regression in migrate create command (#7971)
    • cli: stop using /healthz endpoint to determine server health
    • cli: fix regression with --address flag of hasura console command (#8005)
    • 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: Fix graphql-engine/issues/4633: We can now insert multiple objects that have generated columns in Postgres.