graphql-engine/v3
dependabot[bot] 8a162389cd Bump proc-macro2 from 1.0.89 to 1.0.92 (#1373)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.89
to 1.0.92.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/proc-macro2/releases">proc-macro2's
releases</a>.</em></p>
<blockquote>
<h2>1.0.92</h2>
<ul>
<li>Improve compiler/fallback mismatch panic message (<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/487">#487</a>)</li>
</ul>
<h2>1.0.91</h2>
<ul>
<li>Fix panic <em>&quot;compiler/fallback mismatch 949&quot;</em> when
using TokenStream::from_str from inside a proc macro to parse a string
containing doc comment (<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/484">#484</a>)</li>
</ul>
<h2>1.0.90</h2>
<ul>
<li>Improve error recovery in TokenStream's and Literal's FromStr
implementations to work around <a
href="https://redirect.github.com/rust-lang/rust/issues/58736">rust-lang/rust#58736</a>
such that rustc does not poison compilation on codepaths that should be
recoverable errors (<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/477">#477</a>,
<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/478">#478</a>,
<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/479">#479</a>,
<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/480">#480</a>,
<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/481">#481</a>,
<a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/482">#482</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="acc7d36820"><code>acc7d36</code></a>
Release 1.0.92</li>
<li><a
href="0cb443d935"><code>0cb443d</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/487">#487</a>
from dtolnay/mismatchline</li>
<li><a
href="ae478edd07"><code>ae478ed</code></a>
Change mismatch panic message to avoid github linkifying</li>
<li><a
href="5046761b96"><code>5046761</code></a>
Release 1.0.91</li>
<li><a
href="27c54948b3"><code>27c5494</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/486">#486</a>
from dtolnay/compilerlex</li>
<li><a
href="a9146d6cb5"><code>a9146d6</code></a>
Ensure that compiler tokenstream parsing only produces a compiler
lexerror</li>
<li><a
href="1ce5f04a7e"><code>1ce5f04</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/485">#485</a>
from dtolnay/fallbackident</li>
<li><a
href="75d0818922"><code>75d0818</code></a>
Make parser's fallback Ident symmetric with Group and Literal</li>
<li><a
href="56c3e31df2"><code>56c3e31</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/proc-macro2/issues/484">#484</a>
from dtolnay/fbliteral</li>
<li><a
href="d2c0e611fd"><code>d2c0e61</code></a>
Fix spanned fallback literal construction</li>
<li>Additional commits viewable in <a
href="https://github.com/dtolnay/proc-macro2/compare/1.0.89...1.0.92">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=proc-macro2&package-manager=cargo&previous-version=1.0.89&new-version=1.0.92)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)

</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: ab770bbcd6920bc7886c2c041626bb9ef1659409
2024-11-25 07:05:20 +00:00
..
.cargo Revert "Build: use native target CPU (#1330)" (#1338) 2024-11-12 12:21:37 +00:00
crates Another folder with trailing spaces (#1371) 2024-11-22 17:35:37 +00:00
docs Combine graphql crates together (#1290) 2024-10-29 10:16:46 +00:00
nix Stop Nix rebuilding (#1329) 2024-11-11 12:06:31 +00:00
rfcs RFC | OpenDD changes for field arguments (#682) 2024-06-10 10:29:26 +00:00
static Support nested relationships via remote joins if the connector does not natively support them (#1355) 2024-11-19 05:42:00 +00:00
.dockerignore Include the dev-auth-webhook crate in the workspace. (#500) 2024-04-24 08:12:37 +00:00
.envrc Add instructions for using the Nix Flake (#547) 2024-05-10 12:27:48 +00:00
.envrc.local.example Add instructions for using the Nix Flake (#547) 2024-05-10 12:27:48 +00:00
.gitignore Set the crate properties once, to improve the Nix build. (#334) 2024-03-06 17:15:13 +00:00
.prettierignore Combine graphql crates together (#1290) 2024-10-29 10:16:46 +00:00
.prettierrc Format everything with Prettier. (#530) 2024-04-30 14:58:57 +00:00
Cargo.lock Bump proc-macro2 from 1.0.89 to 1.0.92 (#1373) 2024-11-25 07:05:20 +00:00
Cargo.toml ENG-1280: compress engine's artifacts using zstd (#1364) 2024-11-21 17:10:07 +00:00
changelog.md jsonapi: Support fetching relationships (#1360) 2024-11-21 15:43:03 +00:00
ci.docker-compose.yaml Support nested relationships via remote joins if the connector does not natively support them (#1355) 2024-11-19 05:42:00 +00:00
CONTRIBUTING.md Add UNSTABLE_FEATURES env var (#652) 2024-06-03 08:50:43 +00:00
custom-connector.Dockerfile Bump Rust to 1.82.0 (#1270) 2024-10-25 10:52:05 +00:00
dev-auth-webhook.Dockerfile Bump Rust to 1.82.0 (#1270) 2024-10-25 10:52:05 +00:00
docker-compose.yaml Nested relationships: Refactor capabilities, add engine test, fix docker compose engine metadata (#1341) 2024-11-13 12:28:29 +00:00
Dockerfile Rework GraphQL schema and IR parsing for boolean expressions to fix issues with nested fields (#1361) 2024-11-20 23:38:55 +00:00
flake.lock Bump Rust to 1.82.0 (#1270) 2024-10-25 10:52:05 +00:00
flake.nix Bump all the packages (#1199) 2024-10-03 09:10:06 +00:00
justfile New copy of execution plan in execute (#1365) 2024-11-21 13:14:35 +00:00
README.md Fix docker-compose.yaml (#1197) 2024-10-02 11:07:29 +00:00
rust-toolchain.toml Bump Rust to 1.82.0 (#1270) 2024-10-25 10:52:05 +00:00

Hasura GraphQL Engine V3

Docs

Hasura V3 is the API execution engine, based over the Open Data Domain Specification (OpenDD spec) and Native Data Connector Specifications (NDC spec), which powers the Hasura Data Delivery Network (DDN). The v3-engine expects to run against an OpenDDS metadata file and exposes a GraphQL endpoint according to the specified metadata. The v3-engine needs a data connector to run alongside, for the execution of data source specific queries.

Data connectors

Hasura v3-engine does not execute queries directly - instead it sends IR (abstracted, intermediate query) to NDC agents (aka data connectors). To run queries on a database, we'll need to run the data connector that supports the database.

Available data connectors are listed at the Connector Hub

For local development, we use the reference agent implementation that is a part of the NDC spec.

To start the reference agent only, you can do:

docker compose up reference_agent

Run v3-engine (with Postgres)

Building with Docker

You can also start v3-engine, along with a Postgres data connector and Jaeger for tracing using Docker:

docker compose up

Open http://localhost:3000 for GraphiQL, or http://localhost:4002 to view traces in Jaeger.

Note: you'll need to add {"x-hasura-role": "admin"} to the Headers section to run queries from GraphiQL.

NDC Postgres is the official connector by Hasura for Postgres Database. For running V3 engine for GraphQL API on Postgres, you need to run NDC Postgres Connector and have a metadata.json file that is authored specifically for your Postgres database and models (tables, views, functions).

The recommended way to author metadata.json for Postgres, is via Hasura DDN.

Follow the Hasura DDN Guide to create a Hasura DDN project, connect your cloud or local Postgres Database (Hasura DDN provides a secure tunnel mechanism to connect your local database easily), and model your GraphQL API. You can then download the authored metadata.json and use the following steps to run GraphQL API on your local Hasura V3 engine.

Running tests

To run the test suite, you need to docker login to ghcr.io first:

docker login -u <username> -p <token> ghcr.io

where username is your github username, and token is your github PAT. The PAT needs to have the read:packages scope and Hasura SSO configured. See this for more details.

Running just watch will start the Docker dependencies, build the engine, and run all the tests.

Alternatively, run the tests once with just test

Updating goldenfiles

There are some tests where we compare the output of the test against an expected golden file. If you make some changes which expectedly change the goldenfile, you can regenerate them like this:

just update-golden-files

Some other tests use insta, and these can be reviewed with cargo insta review. If the cargo insta command cannot be found, install it with cargo install cargo-insta.

Run benchmarks

The benchmarks operate against the reference agent using the same test cases as the test suite, and need a similar setup.

To run benchmarks for the lexer, parser and validation:

cargo bench -p lang-graphql "lexer"
cargo bench -p lang-graphql "parser"
cargo bench -p lang-graphql "validation/.*"