Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
Go to file
Daniel Harvey 0b69370cc9 add support for argument presets in models (#348)
<!-- Thank you for submitting this PR! :) -->

## Description

Following on https://github.com/hasura/v3-engine/pull/340 (and stacked
on top of it, as such) - this adds preset arguments for models, allowing
hard coded values for different roles.

```yaml
kind: ModelPermissions
version: v1
definition:
  modelName: ActorsByMovie
  permissions:
  - role: admin
    select:
      filter:
      argumentPresets:
      - argument: movie_id
        value:
          literal: 3
```

<!--
  Questions to consider answering:
  1. What user-facing changes are being made?
2. What are issues related to this PR? (Consider adding `(close
#<issue-no>)` to the PR title)
  3. What is the conceptual design behind this PR?
  4. How can this PR be tested/verified?
  5. Does the PR have limitations?
  6. Does the PR introduce breaking changes?
-->

## Changelog

- Add a changelog entry (in the "Changelog entry" section below) if the
changes in this PR have any user-facing impact. See [changelog
guide](https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide).
- If no changelog is required ignore/remove this section and add a
`no-changelog-required` label to the PR.

### Product
_(Select all products this will be available in)_
- [X] community-edition
- [X] cloud
<!-- product : end : DO NOT REMOVE -->

### Type
<!-- See changelog structure:
https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide#structure-of-our-changelog
-->
_(Select only one. In case of multiple, choose the most appropriate)_
- [ ] highlight
- [X] enhancement
- [ ] bugfix
- [ ] behaviour-change
- [ ] performance-enhancement
- [ ] security-fix
<!-- type : end : DO NOT REMOVE -->

### Changelog entry
<!--
  - Add a user understandable changelog entry
- Include all details needed to understand the change. Try including
links to docs or issues if relevant
  - For Highlights start with a H4 heading (#### <entry title>)
  - Get the changelog entry reviewed by your team
-->

Allow setting preset values for arguments on models, based on user's
role.

<!-- changelog-entry : end : DO NOT REMOVE -->

<!-- changelog : end : DO NOT REMOVE -->

V3_GIT_ORIGIN_REV_ID: 7dd23bf78e92980384cb2b2e109305cdb42d1c0b
2024-03-20 08:42:02 +00:00
.circleci add config to prioritize data/error for remote schema fields 2023-12-19 13:30:30 +00:00
.devcontainer/docs docs: add docs devcontainer 2022-12-16 17:39:29 +00:00
.github Updates the label of issue template feature-request-V3 2024-01-02 08:22:16 +00:00
architecture streaming subscriptions architecture: update try it out instructions 2022-09-29 17:28:01 +00:00
assets Update README for open sourcing the v3 engine. 2023-12-21 09:41:45 +00:00
cabal Jberryman/ghc 9.6.4 2024-01-23 19:47:53 +00:00
cli ci: update latest stable release as v2.37.0 2024-01-31 13:20:16 +00:00
cli-ext cli-ext: Upgrade the node.js version to 16 when packaging. 2023-04-21 09:05:15 +00:00
community docs: update missing opentelemetry logs config 2023-10-09 14:35:42 +00:00
console Deprecation message in Console Folder Readme 2023-02-28 12:05:04 +00:00
contrib/metadata-types Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
dc-agents Jberryman/ghc 9.6.4 2024-01-23 19:47:53 +00:00
docker-compose CI: Test against PostgreSQL 16. 2023-10-05 12:59:17 +00:00
docs add operation_name and parameterized_query_hash to hasura_graphql_requests_total metric 2024-03-18 14:45:09 +00:00
frontend prevent console crash when using native queries in an array relationship 2024-03-12 09:19:09 +00:00
install-manifests ci: update latest stable release as v2.37.0 2024-01-31 13:20:16 +00:00
metadata-api-types Make command to generate types from typed metadata in languages other than Typescript 2023-03-14 14:27:15 +00:00
nix Upgrade nixpkgs to get GHC 9.6.4. 2024-03-18 12:14:30 +00:00
packaging ci: tag release v2.38.0-beta.1 and update base image 2024-03-13 13:55:57 +00:00
preload-mimalloc Fix #9447 bad memory usage 2023-07-25 11:24:57 +00:00
rfcs [RFC] Commands / Mutations on V3 2024-01-29 06:33:52 +00:00
scripts Jberryman/ghc 9.6.4 2024-01-23 19:47:53 +00:00
server Alter log level of garbage collector message (fix #10172) 2024-03-19 16:29:26 +00:00
translations docs: fix sample-apps URLs 2023-06-30 13:48:19 +00:00
v3 add support for argument presets in models (#348) 2024-03-20 08:42:02 +00:00
.dockerignore Create a Docker image specifically for running the Python tests. 2022-09-07 14:29:42 +00:00
.envrc docker: Always use the official SQL Server image for testing. 2023-09-25 13:27:23 +00:00
.envrc.local.example docker: Always use the official SQL Server image for testing. 2023-09-25 13:27:23 +00:00
.ghcversion Jberryman/ghc 9.6.4 2024-01-23 19:47:53 +00:00
.git-blame-ignore-revs frontend: apply prettier 2023-01-25 20:55:24 +00:00
.gitignore Fix default metadata 2023-07-07 15:45:25 +00:00
.hlint.yaml Remove any/all hlint rules 2023-05-18 09:21:20 +00:00
.kodiak.toml ci: don't block merge queue when awaiting review, after #7011 2023-02-07 20:31:27 +00:00
.nvmrc tooling: bump .nvmrc version to 16 2022-09-06 11:23:56 +00:00
.prettierignore Add a missing changelog entry for error message changes to v2.10.0. 2022-09-05 09:41:06 +00:00
cabal.project Jberryman/ghc 9.6.4 2024-01-23 19:47:53 +00:00
cabal.project.freeze Jberryman/ghc 9.6.4 2024-01-23 19:47:53 +00:00
CHANGELOG.md Kriti Documentation 2022-09-06 15:47:18 +00:00
code-of-conduct.md update code of conduct (#2886) 2019-09-16 14:07:52 +05:30
CONTRIBUTING.md Update README for open sourcing the v3 engine. 2023-12-21 09:41:45 +00:00
docker-compose.yaml docker: Always use the official SQL Server image for testing. 2023-09-25 13:27:23 +00:00
event-triggers.md docs: fix sample-apps URLs 2023-06-30 13:48:19 +00:00
flake.lock Upgrade nixpkgs to get GHC 9.6.4. 2024-03-18 12:14:30 +00:00
flake.nix Nix: Wrap GHC and HLS, specifically, to provide (DY)?LD_LIBRARY_PATH. 2023-05-22 14:16:12 +00:00
LICENSE Change license for core GraphQL Engine to Apache 2.0 (#1821) 2019-03-19 16:23:36 +05:30
LICENSE-community add community boilerplates and examples (#430) 2018-09-13 12:00:07 +05:30
Makefile make: Add make targets for formatting and linting frontend code. 2023-03-23 15:16:14 +00:00
metadata.openapi.json Allow reading data connector agent URLs from environment variables 2024-01-04 23:23:32 +00:00
README.md Fix README V2 Link 2024-01-16 08:22:59 +00:00
remote-schemas.md update docs link to avoid redirects 2021-03-01 18:51:18 +00:00
sample.hie.yaml server: Rename "error-message" to "hasura-error-message". 2023-06-27 16:51:06 +00:00
SECURITY.md github md pages: update email address for security team 2022-12-01 17:19:51 +00:00
shell.nix Push the Nix dependency management configuration to the OSS repository. 2022-10-11 15:33:22 +00:00
V2-README.md Update README for open sourcing the v3 engine. 2023-12-21 09:41:45 +00:00

Hasura logo Hasura logo

Hasura GraphQL Engine

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.

Hasura V2

Latest release Docs

Hasura V2 is the current stable version of the Hasura GraphQL Engine. Recommended for production use. Please find more detailed information about the V2 Hasura Graphql Engine in the v2 folder and this README.

Hasura V3

Docs

The future of data delivery. Currently in alpha. Read more

The Hasura V3 engine code, which powers Hasura DDN, is in the V3 folder of this repo. You can find more detailed information about the Hasura DDN Graphql Engine in this README.

The Hasura DDN architecture includes Data Connectors to connect to data sources. All Hasura connectors are also available completely open source. Check out the Connector Hub which lists all available connectors.

Cloning repository

This repository is a large and active mono-repo containing many parts of the Hasura ecosystem and a long git history, that can make the first time cloning of the repository slow and consume a lot of disk space. We recommend following if you are facing cloning issues.

Shallow clone

This will only clone the latest commit and ignore all historical commits.

git clone https://github.com/hasura/graphql-engine.git --depth 1

Git checkout with only Hasura V3 engine code

git clone --no-checkout https://github.com/hasura/graphql-engine.git --depth 1
cd graphql-engine
git sparse-checkout init --cone
git sparse-checkout set v3
git checkout @

This checkouts the top level files and only the v3 folder which contains the Hasura V3 Engine code.

Support & Troubleshooting

To troubleshoot most issues, check out our documentation and community resources. If you have encountered a bug or need to get in touch with us, you can contact us using one of the following channels:

Code of Conduct

We are committed to fostering an open and welcoming environment in the community. Please see the Code of Conduct.

Security

If you want to report a security issue, please read this.

Stay up to date

Join our communities to stay up to date on announcements, events, product updates, and technical blogs. https://hasura.io/community/

Contributing

Check out our contributing guide for more details.

Brand assets

Hasura brand assets (logos, the Hasura mascot, powered by badges etc.) can be found in the v2/assets/brand folder. Feel free to use them in your application/website etc. We'd be thrilled if you add the "Powered by Hasura" badge to your applications built using Hasura. ❤️

Licenses

V2

The V2 core GraphQL Engine is available under the Apache License 2.0 (Apache-2.0).

All other contents in the v2 folder (except those in server, cli and console directories) are available under the MIT License. This includes everything in the docs and community directories.

V3

The Native Data Connectors are available under the Apache License 2.0.

The core V3 GraphQL Engine is intended to be licensed under Apache 2.0. However, due to certain MPL/GPL dependencies, we are restricted. Hasura intends to update these dependencies soon and publish a long term license under which this code gets available.