graphql-engine

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.

APACHE-2.0 License

Downloads
2.1K
Stars
30.8K
Committers
415

Bot releases are hidden (Show)

graphql-engine - v3.alpha.12-19-2023 Release 🚀

Published by manasag 10 months ago

We're thrilled to announce the alpha release of Hasura V3! 🎉

Key Features

  • Data Connectors: The v3-engine can be used with any connector that adheres to the NDC specification to get a GraphQL API. We currently have NDC agents available for Postgres, Clickhouse and Deno (Typescript). Learn more about Hasura connectors here.
  • Metadata Modeling Objects: Use these metadata objects to map the underlying data sources using NDC agents and create a supergraph:
    • Models: collections of data objects that can be queried. These serve as the interface for querying your data. A model may be backed by a database table, an ad-hoc SQL query, a pre-materialized view or a custom API server.
    • Commands: opaque functions or procedures that can be used to query or mutate data. You can use them to validate, process, enrich some data or call another API,
    • Permissions: access control rules on your types / models / commands. There are two types of permissions available - model permissions and type permissions.
    • Relationships: creating edges in your graph from a data type to a model or a command. A relationship allows you to query nested or linked information and it can span across multiple data sources such as from Postgres to Clickhouse.
    • Global ID: is a unique identifier for an object across the entire application, not just within a specific table or type.The Global ID generated by Hasura DDN follows the Relay Global ID spec and can be used to fetch any object directly.
  • GraphQL API Features
    • Queries - Leverage a powerful API to query data with the following features -
      • Simple Queries including query by primary key, running multiple queries in a request, using multiple arguments in the same query, using variables, aliases and fragments.
      • Nested Queries including object and array relationships across data sources.
      • Sorting objects, nested objects, sorting based on nested object’s fields including computed fields, and sorting by multiple fields.
      • Pagination using limit and offset operators including limiting results from an offset, limiting results in a nested object and keyset cursor based
      • Filtering using the where argument with support of the following operators - simple comparison operator, boolean operator, text search operator and nested objects.
      • Directives including @include and @skip for fields.
      • Native Queries for PostgreSQL where each query is specified as SQL and can take arguments using the {{argument_name}} syntax
      • Business Logic - Now write your business logic in Typescript and use Hasura to front them as queries and mutations using the Typescript Deno connector.
    • Mutations - Leverage the flexibility of mutating data with the following ways -
      • Using the Typescript Deno connector which exposes Typescript functions as Hasura commands, which can be made available over the GraphQL API as a mutation. You can write to a database or an API and incorporate any business logic in the Typescript function while mutating.
      • Point to point (simple) database inserts, updates, and deletes via the respective data connectors are coming soon.
  • Authentication: Hasura v3 utilizes "session variables", with specific user, role, organization and any other information you may need to determine the data access rights of the user. Hasura's authentication can be configured via JSON web tokens (JWT) or a webhook service and can be integrated with any other provider you choose.

Alpha Phase

This release marks the initial phase of our alpha rollout. Please note that Hasura V3 is still in its early stages and has limited functionality. We encourage feedback, bug reports, and contributions from the community to help us shape the future of this project.

Get Involved

We're excited to have you on board as we embark on this journey together.

  • Report any bugs or issues you encounter via GitHub Issues.
  • Propose new features or enhancements via Pull Requests.
  • Join the discussions in our Discord channel.

Your participation and feedback are invaluable as we work towards more updates and exciting features in the upcoming releases! 🚀

graphql-engine - v2.11.6

Published by scriptnull over 1 year ago

Changelog

This is a patch release for v2.11

Bug fixes and improvements

Server

Hasura doesn't allow certain queries to be cached. Namely, Remote Schema or Action queries with forward_client_headers set to true.

Currently, Hasura throws an error and fails the query. The behavior is now changed to not throw an error. Hasura now always fetches data from the upstream API, skips the cache, and returns the response with a Warning header.

The warning headers are as follows:

warning: 199 - Actions that forward client headers cannot currently be cached
  
warning: 199 - Remote schemas or joins that forward client headers cannot currently be cached

Note that Remote Schemas with forward_client_headers: true were erroneously allowed to cache before.

The following bugs are also fixed -

  • Include Remote Schema root fields also in the cache restriction check
  • Include Remote Schema-to-Remote Schema joins also in the caching restriction check

(Enterprise edition only)

Build

Updates base image of graphql-engine to the latest available ubuntu update to avail all the security patches.

graphql-engine - v2.11.5

Published by scriptnull over 1 year ago

Changelog

❗ Patch for a critical security vulnerability. See more details in the security advisory.

graphql-engine - v1.3.4

Published by scriptnull over 1 year ago

Changelog

❗ Patch for a critical security vulnerability. See more details in the security advisory.

graphql-engine - v2.14.0

Published by imperfect-fourth almost 2 years ago

Changelog

Highlights

GraphQL Type Generator in Actions

While creating a new Action, now you can use a type generator on the Console to easily create GraphQL types from JSON sample requests

Aggregate functions in where-clauses

We now support aggregation functions in where-clauses, initially requested in #1498, see docs.

This allows queries such as the following to fetch the names of students that have an average grade above a certain value across their science classes:

query {
  students(_where: {
   classes_aggregate: {
     average: {
       arguments: "grade",
       filter: {department: {_eq: "science"}},
       predicate: { _gt: 10 }
     }
  })
 {
   name
 }

Bug fixes and improvements

Server

  • Aggregation Predicates now generate graphql types names which are less prone to conflicts. The entire feature can now be disabled via the experimental feature flag hide_aggregation_predicates.
  • add IF EXISTS while dropping the constraint in source migrations (2 -> 3)
  • pg_dump has been upgraded in order to support PostgreSQL 15.
  • fix batch_size behaviour for auto event trigger log cleanup (Enterprise edition only)
  • Use only accepted requests for calculating rate limiting (Enterprise edition only)
  • When conflicting type definitions are encountered, show their definitions in the error message
  • Remove spaces before colons in error messages and descriptions
  • BigQuery: Strings in suitable notation are now permitted for all numerical input fields.
  • Fix type name generation in the GraphQL schema for aggregation predicate functions to avoid conflicts
  • Fix swapping of the the idle_timeout and max_connections fields for MySQL connection pool settings while applying metadata.
  • Replacing the metadata will now reload all affected sources. Previously, the GraphQL Engine would re-use the cached data from the sources which could lead to a stale schema.
  • Add origin of errors in error messages of streaming subscription to help find source of errors
  • Extend the Config API to report whether the Prometheus metrics API has been enabled. (Enterprise edition only)
  • Add hide_update_many_fields experiment feature flag which allows GraphQL Engine to be started without including _updates fields. This is useful for resolving errors where the new fields conflict with existing table names. (fix #8844)
  • Avoid exporting the backend_only flag for delete permissions if it is set to false while exporting metadata to make it consistent with insert and update permissions.
  • Support count-star aggregates in CockroachDB.
  • Fix bug that didn't stream any data when the cursor column of a streaming subscription had a custom identifier set. (fix #8985)

Console

  • Fixes failures/indefinite loading during operation inspection in monitoring tab. (Enterprise edition only)
  • Add the functionality to customize the GraphQL field name for the update_many operation
  • Fix dropping of existing configured response transforms while updating an action
  • Show event trigger invocation logs on the console if only event logs are cleaned.
  • Fix auto-cleanup frequent frequencies dropdown on event triggers modify page. (Enterprise edition only)
  • Fix local object relationship deletion in new relationships page (fix #9024)
  • Fix inserting of JSON object for Citus and CockroachDB (fix #9015)
  • Fix browse rows page filters for BigQuery and add new operators (in, not in, like, not like) (fix #9023)
  • Add Try it button on the table pages to quickly try GraphQL operations on the table using the API explorer.
  • Fix export to CSV on the table browse rows page when special characters are present in the data. (fix #7537)

CLI

  • Correctly export query_collections.yaml when query_collections object in metadata JSON contains at least one definition.queries as an empty array. (fixes #8787)
graphql-engine - v2.14.0-beta.2

Published by imperfect-fourth almost 2 years ago

Changelog

Bug fixes and improvements

Server

  • Aggregation Predicates now generate graphql types names which are less prone to conflicts. The entire feature can now be disabled via the experimental feature flag hide_aggregation_predicates.
  • add IF EXISTS while dropping the constraint in source migrations (2 -> 3)

Console

  • Enable the Add operation to allowlist button on the monitoring tab
graphql-engine - v2.14.0-beta.1

Published by imperfect-fourth about 2 years ago

Changelog

Highlights

Aggregate functions in where-clauses

We now support aggregation functions in where-clauses, initially requested in #1498, see docs.

This allow queries such as the following to fetch the names of students that have an average grade above a certain value across their science classes:

query {
  students(_where: {
   classes_aggregate: {
     average: {
       arguments: "grade",
       filter: {department: {_eq: "science"}},
       predicate: { _gt: 10 }
     }
  })
 {
   name
 }

GraphQL Type Generator in Actions

While creating a new Action, now you can use a type generator on the Console to easily create GraphQL types from JSON sample requests

Bug fixes and improvements

  • server: When conflicting type definitions are encountered, show their definitions in the error message
  • server: Remove spaces before colons in error messages and descriptions
  • server: Strings in suitable notation are now permitted for all numerical input fields.
  • server: Fix type name generation in the GraphQL schema for aggregation predicate functions to avoid conflicts
  • server: Fix swapping of the the idle_timeout and max_connections fields for MySQL connection pool settings while applying metadata.
  • server: Replacing the metadata will now reload all affected sources. Previously, the GraphQL Engine would re-use the cached data from the sources which could lead to a stale schema.
  • server: Add origin of errors in error messages of streaming subscription to help find source of errors
  • server: Add hide_update_many_fields experiment feature flag which allows GraphQL Engine to be started without including _updates fields. This is useful for resolving errors where the new fields conflict with existing table names. (fix https://github.com/hasura/graphql-engine/issues/8844)
  • server: Avoid exporting the backend_only flag for delete permissions if it is set to false while exporting metadata to make it consistent with insert and update permissions.
  • server: Support count-star aggregates in CockroachDB.
  • server: Fix bug that didn't stream any data when the cursor column of a streaming subscription had a custom identifier set. (fix 8985)
  • console: Add the functionality to customize the GraphQL field name for the update_many operation
  • console: Fix dropping of existing configured response transforms while updating an action
  • console: Show event trigger invocation logs on the console if only event logs are cleaned.
  • console: Move auto-cleanup config on event triggers modify page
  • console: Fix local object relationship deletion in new relationships page (fix https://github.com/hasura/graphql-engine/issues/9024)
  • console: Fix inserting of JSON object for Citus and CockroachDB (fix https://github.com/hasura/graphql-engine/issues/9015)
  • console: Fix browse rows page filters for BigQuery and add new operators (in, not in, like, not like) (fix https://github.com/hasura/graphql-engine/issues/9023)
  • console: Add Try it button on the table pages to quickly try GraphQL operations on the table using the API explorer.
  • console: Fix export to CSV on the table browse rows page when special characters are present in the data. (fix https://github.com/hasura/graphql-engine/issues/7537)
  • cli: Correctly export query_collections.yaml when query_collections object in metadata JSON contains at least one definition.queries as an empty array. (fixes #8787)
graphql-engine - v2.13.0

Published by imperfect-fourth about 2 years ago

Changelog

Auto cleanup for event triggers

(Enterprise edition only)

You can now configure automatic clean up of event triggers logs with various configuration parameters. Read more about it here

auto-cleanup

Source health checks

(Enterprise edition only)

Introducing health checks for data sources. Health check on a source can be enabled and configurable via an optional health_check field in the source metadata.
Example for a Postgres source.

POST /v1/metadata HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin

{
  "type":"pg_add_source",
  "args":{
    "name":"<db_name>",
    "configuration":{
      "connection_info":{
        "database_url":{
          "from_env":"<DATABASE_URL_ENV>"
        }
      }
    },
    "health_check": {
      "test": {
        "sql": "SELECT 1"
      },
      "interval": 300,
      "timeout": 5,
      "retries": 3,
      "retry_interval": 5
    }
  }
}

Please refer to our docs for more information.

Reporting source health check

(Enterprise edition only)

Health check reports of sources can be obtained through a GET request from the /healthz/sources, an admin-only endpoint, on demand. Learn more about the API here.

Currently, Hasura supports enabling health checks on Postgres and MS SQL Server databases. Support for other data sources will be added soon.

Bug fixes and improvements

  • server: Strings in suitable notation are now permitted for all numerical input fields.
  • server: Fix bug that didn't stream any data when the cursor column of a streaming subscription had a custom identifier set.
  • server: fix handling non-latin text elements in array literals in Postgres (fix #8961)
  • server: Make args optional in BigQuery computed fields that are backed by functions that don't take any user-specified arguments. (close #8904)
  • server: Fix an issue the server's handling of the graphql-ws protocol, in which the server can cause an infinite ping-pong loop. (fix #8967)
  • server: Add get_rows_count arg in get_event_invocations and get_scheduled_events metadata APIs, when it is false, the total rows count is not included in the response.
  • server: drop associated event triggers when a source is removed via the replace_metadata metadata API
  • server: update tracing log to use original hex values sent in request header
  • server: Improve error reporting when root fields originating from Actions or Remote schemas conflict
  • server: fix applying migrations when the same SQL function is used as both a computed field and as a root field (fix #8643)
  • server: Support 128-bit trace ids (Enterprise edition only)
  • console: fix local object relationship deletion in new relationships page (fix #9024)
  • console: Add a shortcut for creating a query collection operation using the introspection query or any query defined in the GraphiQL tab
  • console: add schema preview for remote schemas
  • console: Remove the old allow list section and add a link to the new Allow List Manager in the settings.
  • console: Fix column selection bug for select and insert permissions on the table permissions page (fix #8937)
  • console: allow users to edit comments on DB views using the console (fix #8846)
  • console: allow resizing GraphiQL in API explorer (fix #8880)
  • cli: Fix schema block being dropped from SDL when exporting remote schema permissions (fix #8579)
graphql-engine - Urgent security patch for 1.2

Published by shahidhk over 4 years ago

🚨 🚨 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 [email protected] or on our website chat if you have any questions and need help.

Security advisory and details published here: https://github.com/hasura/graphql-engine/security/advisories/GHSA-j622-hw7j-c72x

graphql-engine - First patch release for 1.1

Published by shahidhk over 4 years ago

This release brings few server-only changes that resolve potential space leaks:

  • Event Triggers refactor with backpressure. HASURA_GRAPHQL_EVENTS_FETCH_INTERVAL changes semantics slightly: we sleep for the interval only when there were previously no events to process: c425b554b8ecf2ef8897be70127d445bc8ac9326
  • More robust forking of threads: c52bfc540d8a480d5f0d571ee412353d34f5d040
  • Better assertions while doing mutable writes: 3a284c0d5d1847af285cd86e277b645b11e8ed97
graphql-engine - 2nd beta release for 1.2.0

Published by shahidhk over 4 years ago

This release fixes bugs that were identified in the 1st beta release.

Changelog

  • server: Don't update catalog version if using --dryRun (#3970)
  • server, cli: use prerelease tag as channel for console assets cdn (#3927)
  • cli: bug fixes related to actions (#3951)
  • cli(actions): preserve action definition in metadata apply (fix… (#3993)
  • cli: fix flags in actions, migrate and metadata cmd (fix #3982) (#3991)
  • cli: add version flag in update-cli command (#3996)

Using this release

Use the following docker image:

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

CLI

Download the binary:

graphql-engine - 1st beta release for 1.2.0

Published by shahidhk over 4 years ago

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.

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

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:

# 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

Read more about this command in the docs.

(close #1156) (#3760)

Bug fixes and improvements

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

Using this release

Use the following docker image:

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

CLI

Download the binary:

graphql-engine - v1.0.0-alpha04

Published by shahidhk over 6 years ago

Changelog:

  • server: catch and log http exceptions from auth webhook, closes #28
  • server: use row expressions instead of json_build_object
  • cli: handle server endpoints that contains a url path (#64)
  • console: update tests, add access key login
graphql-engine - v1.0.0-alpha03

Published by shahidhk over 6 years ago

Changelog

  • server: support environment variables for flags, close #45
  • server: process headers only for known urls, fix #46
  • cli: updated test (#47)
graphql-engine - v1.0.0-alpha02

Published by shahidhk over 6 years ago

  • CLI handles server, console versions.
graphql-engine - v1.0.0-alpha01

Published by shahidhk over 6 years ago

Pre-release version v1.0.0-alpha01

Package Rankings
Top 3.34% on Npmjs.org
Top 3.61% on Proxy.golang.org
Related Projects