Hasura directive. This repo features examples of Actions to perform custom business logic with Hasura. This can help reduce the number of requests to your data sources and improve the performance of your application. Learn more about filtering queries and the use of variables, aliases, fragments, and directives. Use Variables / Aliases / Fragments / Directives in Queries Using variables In order to make a query re-usable, it can be made dynamic by using variables. We wrote about GraphQL directives at length in this article. How Caching Works Introduction Hasura Caching is a type of response caching that helps you store results of a given query in order to serve it more quickly to your users. Ways to Query Apr 23, 2019 路 Using GraphQL directives like @skip and @include, but it seems these only apply to fields returned, not to any part of a where filter Using Hasura boolExp s like _is_null and _or, but it seems these can't test variables directly, they can only compare variables to columns contents Introduction Hasura Cloud and Enterprise Edition provide support for caching query responses. The GraphQL Foundation’s Composite Schema Working Group, which includes engineers from various organizations across the industry including Apollo GraphQL, ChilliCream, Graphile, Hasura, Netflix and The Guild, is actively working on creating an official specification for GraphQL Federation. Sample Apps with Hasura GraphQL This directory contains community-contributed code and content that supplements Hasura GraphQL Engine. Each example comes with it's own schema with relevant migration files to get started. May 7, 2025 路 The Hasura Cloud Terms of Service for using Hasura Platform or Hasura Services on cloud via Hasura’s website. Example: Fetch an author by their author_id: Well, you just supercharged your query performance using Hasura caching. An example of a directive in Hasura Cloud is providing a `cached` directive. Learn all about GraphQL directives in this article where we talk about specification directives, Hasura directives, and community defined directives for architecting the perfect API. Oct 15, 2021 路 Where does Hasura fit in this whole architecture? In this post, we will talk about how to architect your app to add Hasura that already has an existing system running. It includes several example applications built using GraphQL Engine to demonstrate its features, several boilerplates for users to get started with any popular frontend framework of choice. You have access to a huge array of options, including ands, nots, ors, or checking if something exists in another table. Discover functionalities like simple queries, nesting, sorting, pagination, and employing multiple arguments or queries. You can now use the @cached directive to add caching to your queries, set the length of time they should live for with the TTL directive and force a cache refresh if you need to. In this step of our multi-part tutorial, we are going to configure Hasura as our application’s back-end. Dec 3, 2025 路 Hasura is an open-source, GraphQL flavored “back-end-as-a-service” which plays very well with Hygraph given they both share the GraphQL underpinnings. This will drastically improve performance for queries which are executed frequently. This includes any GraphQL query including Actions and Remote Schemas. This process requires that your auth service returns a JWT to the client, which it passes to Hasura GraphQL Engine in an: Authorization: Bearer <JWT> header of the request. 馃帀 See the caching config section for a full description of the caching configuration options. Authentication Using JWTs Introduction This page details how to configure Hasura Engine to use JWT mode in order to authenticate incoming requests. Hasura will cache the response of a given query under a cache key, and when another request comes in which computes to the same cache key then it will deliver the cached result, without needing to query the underlying data Directives Directives allow us to provide variable execution for our queries based on small syntactical changes. Cached responses are stored for a period of time in a LRU (least-recently used) cache, and removed from the cache as per a user-specified TTL (time Let us look at how to use Hasura in a system which already has existing GraphQL and REST APIs to leverage production ready features like Authorization and Caching. Because Hasura understands your JWT / Auth it adds a level of power to their permission system. Hasura then verifies and decodes the JWT to extract x-hasura-* session In-depth guide to conducting GraphQL Queries and harnessing the full potential of Hasura's GraphQL API. Hasura GraphQL Engine (OSS) supports Query Caching where the internal representation of the fully qualified GraphQL AST is cached. Hasura Cloud and Enterprise Editions provide a caching layer that can be used to cache the response of a GraphQL query. . The arguments for this directive are ttl (time to live), defined in seconds with an upper bound of 300 seconds, and a boolean refresh argument to declare if the cache should be automatically cleared or not. The Hasura engine is an open source project which supercharges the building of modern applications by providing access to data via a single, composable, secure API endpoint. Sep 28, 2021 路 The Hasura API enables an additional directive called @cached that enables automatic caching on Hasura Cloud. sdky xfzlw ejvcj nwq wrr jqoipvd qfnjj xnqhnx xhzg xkynmg