Commit Graph

341 Commits

Author SHA1 Message Date
Tom Harding
e4c5d7a752 Add the SubgraphIdentifier type (#613)
## Description

Parallel to #611, in service of removing supergraph config, we'd like to
map all current supergraph config into a generated subgraph. To ensure
that we don't end up with an unfortunate naming collision, I've decided
to refine the definition of a subgraph identifier to exclude any string
starting with `__internal`, which we can then have as our "internal
namespace". This change introduces the new type, and updates the
"unknown_namespace" subgraph to come under this umbrella.

This change should be a no-op to any user who hasn't used a subgraph
name prefixed with `__internal`.

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

User-defined subgraphs may no longer be given names that start with
`__internal`, as this will be reserved for internally generated
subgraphs.

- 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
- [ ] enhancement
- [ ] bugfix
- [x] 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
-->

User-defined subgraphs may no longer have names that start with
`__internal`.

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

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

V3_GIT_ORIGIN_REV_ID: a6df1bba7b1f2cda4593654c15d168f25b7134b2
2024-05-27 10:06:42 +00:00
dependabot[bot]
0b16216bad Bump anyhow from 1.0.82 to 1.0.86 (#617)
V3_GIT_ORIGIN_REV_ID: b5611a05dd14177ed1391edffa84dc8c82a355c6
2024-05-27 07:54:46 +00:00
dependabot[bot]
29f64ad5a8 Bump proc-macro2 from 1.0.81 to 1.0.84 (#616)
V3_GIT_ORIGIN_REV_ID: 99f387f6fade155355789e9b7ae57ee8407358a2
2024-05-27 07:29:57 +00:00
Tom Harding
da62dfb2b0 Allow supergraph config to appear in subgraphs (#611)
## Description

As per [APG-113](https://hasurahq.atlassian.net/browse/APG-113), we
would like to remove the separate concept of supergraphs. This is the
first step: we allow the supergraph config to appear in subgraphs. The
next step will be to remove the non-subgraph version of it.

This PR updates the subgraph enum type to allow for supergraph config
objects, but does nothing else. This means it should be a no-op for
current users, but will be forward-compatible with the eventual goal of
the epic. We also throw in a makeshift test framework that we can
probably replace with Insta at a later date.

<!--
  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
- [ ] enhancement
- [ ] bugfix
- [x] 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
-->

Supergraph configuration (`CompatibilityConfig`, `AuthConfig`, and
`GraphqlConfig`) may now be defined in any subgraph. Note that
supergraph configuration may still only be defined once for any given
supergraph.

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

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

[APG-113]:
https://hasurahq.atlassian.net/browse/APG-113?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

V3_GIT_ORIGIN_REV_ID: a1b9911c4abb332fe37914efd1c3afbbd554a5d0
2024-05-24 08:59:55 +00:00
Rakesh Emmadi
8814334c64 Bug Fix: use Exists clause for relationship filter predicates (#605)
This PR attempts to fix and improve the resolution of filter predicates:
- Use `Exists` clause for relationship field expressions.
- The filter clause will apply the predicates at the relationship
collection level, so no need to track the relationship path.
- Modify the helper functions to return a specific NDC boolean
expression instead of a list of the same.

V3_GIT_ORIGIN_REV_ID: b0e978878f2a837f414f60b63889b0d5fe045917
2024-05-23 15:38:07 +00:00
Anon Ray
def7362ea5 test for concurrent execution of query root fields (#609)
## Description

Add a helper function which execute items of an iterator concurrently.
Add unit tests for that.

Use the helper function in query root fields execution.

V3_GIT_ORIGIN_REV_ID: a034291684135072cbaf957dc788a269b5a33459
2024-05-23 12:57:54 +00:00
Daniel Chambers
df19b15bc8 Fix parallel execution of root fields (#607)
## Description
This PR fixes a bug where the engine does not actually execute root
fields in parallel when it is supposed to be doing so.

Consider the following GraphQL query that is invoking a typescript
function that sleeps for 5 seconds three times:

```graphql
query MyQuery {
  test1: app_hello(name: "test1")
  test2: app_hello(name: "test2")
  test3: app_hello(name: "test3")
}
```

This should execute in 5 seconds, as these should be run in parallel.
Instead, it actually takes 15 seconds as they are run sequentially.

Here's a trace from before the change:

![image](https://github.com/hasura/v3-engine/assets/1214352/d52d99e7-b4da-4bbb-bbf9-5155ef568d76)

And here's a trace from after the change:

![image](https://github.com/hasura/v3-engine/assets/1214352/26a3ac1f-9e9c-4067-aa1b-62aaa4b293c2)

## Changelog

### 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
- [ ] enhancement
- [x] 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
-->

Fixed a bug in the engine that prevented the parallel execution of query
root fields

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

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

V3_GIT_ORIGIN_REV_ID: 2d4dd195037d49577608892fc6fa0237d8fd26c4
2024-05-23 08:19:42 +00:00
Daniel Harvey
0551a78246 Remove data connector-specific information from resolved ObjectBooleanExpressionType (#604)
<!-- Thank you for submitting this PR! :) -->

## Description

The new `BooleanExpressionType` for objects is not tied to a single data
connector. As we'll be attempting to compile both input kinds into the
same resolved metadata types, let's make sure we depend on this
information as little as possible.

Mostly this is absolutely fine, the only time we now use this
information (other than still checking it for user errors) is when
juggling relationships when generating GraphQL schema items for a
boolean expression. We will have to cross this bridge when we come to
it.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 9550217e253fb71df09251928ab9b30750617c9e
2024-05-22 09:28:54 +00:00
Daniel Harvey
16e3de49c1 Deduplicate resolve_model_predicate (#603)
<!-- Thank you for submitting this PR! :) -->

## Description

Resolves https://hasurahq.atlassian.net/browse/V3ENGINE-124

Deduplicates `resolve_model_predicate` and
`resolve_model_predicate_with_type`, making the former call the latter.

Fixed now because this was making new boolean expression type changes
harder.

Doing so revealed and fixed a bug in predicate relationships (since
we're using the same code for everything, suddenly there were a lot of
failing tests).

<!--
  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
- [ ] enhancement
- [X] 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
-->

Fix relationships between predicates

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

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

V3_GIT_ORIGIN_REV_ID: 4adfdbdb544062548d4664067bf8c3ac53e51d52
2024-05-21 17:23:50 +00:00
Daniel Harvey
13f65f3112 Split resolved scalar types from DataConnectors info (#601)
<!-- Thank you for submitting this PR! :) -->

## Description

Previously we resolved `DataConnectors` and then later resolved scalar
type representations and bundled them together. That's making
`BooleanExpressionType` stuff harder, so let's separate them.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 23a70b802b3f4b5ba9f25369491b794707265445
2024-05-21 16:03:59 +00:00
Daniel Harvey
951f994bec Fix minor formatting (#602)
<!-- Thank you for submitting this PR! :) -->

## Description

We have a formatting check job but it was not a required check so it got
missed, this fixes everything and will make the check required in
Github. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 514478f2a48482ca34a860fedcfe6185b29c1dc3
2024-05-21 11:33:06 +00:00
Daniel Harvey
b138cd2017 OpenDD types for new boolean expressions (#599)
<!-- Thank you for submitting this PR! :) -->

## Description

We have a new `BooleanExpressionType` metadata kind. This adds it, tests
it can be parsed, but hides it from generated metadata and throws an
error if one is actually used in the engine.

V3_GIT_ORIGIN_REV_ID: 036b5fd9c32475d1c5a5e5e6321fb736fe6caefa
2024-05-21 09:28:53 +00:00
Daniel Chambers
068f2cb106 RFC: Aggregates and Groups (#563)
V3_GIT_ORIGIN_REV_ID: c90830e0392421468fa532d6211c4ab903db472a
2024-05-21 07:41:40 +00:00
Rakesh Emmadi
56f949a279 No-op refactor routes related code in engine main.rs (#600)
This PR aims to improve the routes-related code in the engine's main.rs
file. The optional presence of metadata routes and the CORS layer is now
expressed through types.

V3_GIT_ORIGIN_REV_ID: 71b5bc66b5cc05aa6ed64ae32a54c2e13266e3be
2024-05-20 15:54:45 +00:00
Daniel Harvey
1d9ae59f72 [opendds-derive]: allow hiding enum variants from JSONSchema (#598)
<!-- Thank you for submitting this PR! :) -->

## Description

We want to be able to add work in progress types to `opendds` without
making them visible in the public API. This PR adds the `#[opendd(hidden
= true)]` annotation that can be used to do this.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 69e1db47fd3d3fbe8e2cef387423d626096457e0
2024-05-20 13:30:56 +00:00
Daniel Harvey
3998ca3fb7 Remove unused files (#587)
<!-- Thank you for submitting this PR! :) -->

## Description

These files have been moved to `crates/schema`, don't know how they
ended up back. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 0cdda71476e84f06c5adab9273c08c843a6f945e
2024-05-20 09:28:43 +00:00
Daniel Harvey
8753e5a129 Internal flags for metadata resolve (#589)
<!-- Thank you for submitting this PR! :) -->

## Description

This adds the smallest possible changes to allow the use of different
options when resolving metadata. The concrete idea is this:
- each crate (`metadata-resolve`, `schema` etc) will have a type for
their flags (if any), but don't care where they come from
- when we need to expose these experimental features through the engine
(ie, to test requests in e2e tests or something), the engine will parse
an env var such as
`EXPERIMENTAL_FEATURES=allow_boolean_expression_types` and then use it
to construct `MetadataResolveFlags`, `SchemaFlags`, etc.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 64ac66569f4e31829a9117c64d2e0e265d7a7303
2024-05-20 09:12:57 +00:00
dependabot[bot]
d1660cb951 Bump schemars from 0.8.19 to 0.8.20 (#592)
Bumps [schemars](https://github.com/GREsau/schemars) from 0.8.19 to
0.8.20.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/GREsau/schemars/releases">schemars's
releases</a>.</em></p>
<blockquote>
<h2>v0.8.20</h2>
<h3>Fixed:</h3>
<ul>
<li>Revert unintentional change in behaviour when combining
<code>default</code> and <code>required</code> attributes (<a
href="https://redirect.github.com/GREsau/schemars/issues/292">GREsau/schemars#292</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/GREsau/schemars/blob/master/CHANGELOG.md">schemars's
changelog</a>.</em></p>
<blockquote>
<h2>[0.8.20] - 2024-05-18</h2>
<h3>Fixed:</h3>
<ul>
<li>Revert unintentional change in behaviour when combining
<code>default</code> and <code>required</code> attributes (<a
href="https://redirect.github.com/GREsau/schemars/issues/292">GREsau/schemars#292</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7ecaa7feab"><code>7ecaa7f</code></a>
Revert unintentional change in behaviour when combining
<code>default</code> and `requir...</li>
<li><a
href="cf5be1b266"><code>cf5be1b</code></a>
Ignore failing test</li>
<li><a
href="449bb1a0ca"><code>449bb1a</code></a>
Add more tests for different schema settings</li>
<li>See full diff in <a
href="https://github.com/GREsau/schemars/compare/v0.8.19...v0.8.20">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=schemars&package-manager=cargo&previous-version=0.8.19&new-version=0.8.20)](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>
V3_GIT_ORIGIN_REV_ID: 0a55128d53088b9b0c8c8f2dc5fb03de8af09413
2024-05-20 08:45:48 +00:00
dependabot[bot]
7146fd4f23 Bump rmp-serde from 1.1.2 to 1.3.0 (#596)
Bumps [rmp-serde](https://github.com/3Hren/msgpack-rust) from 1.1.2 to
1.3.0.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/3Hren/msgpack-rust/commits/rmp-serde/v1.3.0">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rmp-serde&package-manager=cargo&previous-version=1.1.2&new-version=1.3.0)](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>
V3_GIT_ORIGIN_REV_ID: c03bfaa8c506b69a06b9a0563ce2e70df21df11e
2024-05-20 08:30:59 +00:00
dependabot[bot]
f40a40089f Bump syn from 2.0.63 to 2.0.65 (#594)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.63 to 2.0.65.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/syn/releases">syn's
releases</a>.</em></p>
<blockquote>
<h2>2.0.65</h2>
<ul>
<li>Optimize the implementation of <code>Fold</code> to compile faster
(<a
href="https://redirect.github.com/dtolnay/syn/issues/1666">#1666</a>, <a
href="https://redirect.github.com/dtolnay/syn/issues/1667">#1667</a>, <a
href="https://redirect.github.com/dtolnay/syn/issues/1668">#1668</a>)</li>
</ul>
<h2>2.0.64</h2>
<ul>
<li>Support using ParseBuffer across <code>catch_unwind</code> (<a
href="https://redirect.github.com/dtolnay/syn/issues/1646">#1646</a>)</li>
<li>Validate that the expression in a let-else ends in brace as required
by rustc (<a
href="https://redirect.github.com/dtolnay/syn/issues/1648">#1648</a>, <a
href="https://redirect.github.com/dtolnay/syn/issues/1649">#1649</a>)</li>
<li>Legalize invalid const generic arguments by wrapping in braces (<a
href="https://redirect.github.com/dtolnay/syn/issues/1654">#1654</a>, <a
href="https://redirect.github.com/dtolnay/syn/issues/1655">#1655</a>)</li>
<li>Fix some expression precedence edge cases involving
<code>break</code> and <code>return</code> in loop headers (<a
href="https://redirect.github.com/dtolnay/syn/issues/1656">#1656</a>)</li>
<li>Always print closure bodies with a brace when the closure has an
explicit return type (<a
href="https://redirect.github.com/dtolnay/syn/issues/1658">#1658</a>)</li>
<li>Automatically insert necessary parentheses in ToTokens for Expr when
required by expression precedence (<a
href="https://redirect.github.com/dtolnay/syn/issues/1659">#1659</a>)</li>
<li>Support struct literal syntax in match guard expressions (<a
href="https://redirect.github.com/dtolnay/syn/issues/1662">#1662</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9f2371eefa"><code>9f2371e</code></a>
Release 2.0.65</li>
<li><a
href="4cd181325f"><code>4cd1813</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/syn/issues/1668">#1668</a>
from dtolnay/foldhelper</li>
<li><a
href="ed54092bce"><code>ed54092</code></a>
Eliminate gen::helper module</li>
<li><a
href="eacc8ab1b9"><code>eacc8ab</code></a>
Eliminate FoldHelper trait</li>
<li><a
href="6e20bb8d77"><code>6e20bb8</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/syn/issues/1667">#1667</a>
from dtolnay/punctuatedfold</li>
<li><a
href="9d95cab6d3"><code>9d95cab</code></a>
Optimize punctuated::fold</li>
<li><a
href="82ffe86c2b"><code>82ffe86</code></a>
Move Punctuated fold helper to punctuated module</li>
<li><a
href="3dfacc1538"><code>3dfacc1</code></a>
Ignore manual_map clippy lint</li>
<li><a
href="7273aa77aa"><code>7273aa7</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/syn/issues/1666">#1666</a>
from dtolnay/foldhelper</li>
<li><a
href="8124c0eb99"><code>8124c0e</code></a>
Generate fewer monomorphizations in Fold</li>
<li>Additional commits viewable in <a
href="https://github.com/dtolnay/syn/compare/2.0.63...2.0.65">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=syn&package-manager=cargo&previous-version=2.0.63&new-version=2.0.65)](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>
V3_GIT_ORIGIN_REV_ID: de8f887fc8a56213660a966c2206fe2757005fbb
2024-05-20 08:10:58 +00:00
dependabot[bot]
786c2b9fbc Bump serde from 1.0.201 to 1.0.202 (#595)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.201 to
1.0.202.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/serde-rs/serde/releases">serde's
releases</a>.</em></p>
<blockquote>
<h2>v1.0.202</h2>
<ul>
<li>Provide public access to RenameAllRules in serde_derive_internals
(<a
href="https://redirect.github.com/serde-rs/serde/issues/2743">#2743</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9e32a40b1c"><code>9e32a40</code></a>
Release 1.0.202</li>
<li><a
href="87f635e54d"><code>87f635e</code></a>
Release serde_derive_internals 0.29.1</li>
<li><a
href="d4b2dfbde2"><code>d4b2dfb</code></a>
Merge pull request <a
href="https://redirect.github.com/serde-rs/serde/issues/2743">#2743</a>
from dtolnay/renameallrules</li>
<li><a
href="f6ab0bc56f"><code>f6ab0bc</code></a>
Provide public access to RenameAllRules in serde_derive_internals</li>
<li><a
href="48cc2a6327"><code>48cc2a6</code></a>
Replace use of a syn From impl</li>
<li><a
href="3202a6858a"><code>3202a68</code></a>
Skip rerunning build script on library code changes</li>
<li>See full diff in <a
href="https://github.com/serde-rs/serde/compare/v1.0.201...v1.0.202">compare
view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde&package-manager=cargo&previous-version=1.0.201&new-version=1.0.202)](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: Anon Ray <ecthiender@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: f6b8f6681b607a89712676456bd688a4b3cb89c3
2024-05-20 07:54:47 +00:00
Daniel Harvey
2bb8be9fa7 Split out execute crate (#588)
<!-- Thank you for submitting this PR! :) -->

## Description

Following `metadata-resolve` and `schema` crates, this splits out
`execute`, the largest folder in `engine`. Undoubtedly this could be
split further.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: c272908153f78212d1f5dd58819707ac3cbcd439
2024-05-17 14:42:23 +00:00
Daniel Harvey
f379ee44ec Update test expectations (#590)
<!-- Thank you for submitting this PR! :) -->

## Description

These tests started failing once they're run against the latest
`ndc-postgres`. We've just fixed some bugs in nested filtering, so
hopefully these are expected changes?

V3_GIT_ORIGIN_REV_ID: 373b2217c7f4ed81f0479edd1941762fc892a5c0
2024-05-17 14:26:39 +00:00
Daniel Harvey
0dff3ea3a2 Update Rust to 1.78.0 and fix suggestions (#586)
Bump Rust compiler to
[1.78.0](https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html).

Fix a few new warnings. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 3d8f0626ebb988fb7bd80ad8aa5d6c2d8c3d7f24
2024-05-16 15:07:15 +00:00
Anon Ray
fb1fc29f34 fix cargo doc warnings (#585)
## Description

As advertised.

Now you can run the following to browse our internal code

```
cargo doc --no-deps --document-private-items --open
```

V3_GIT_ORIGIN_REV_ID: 5b7091a00ed6148b8a91168807b07aa6a925cac9
2024-05-16 09:04:54 +00:00
Anon Ray
84a0644208 remote join: minor fixes and code comments (#575)
## Description

- Removes the `argument_id` as we use the argument itself as the unique
key now.
- Better naming of some functions and types
- Some code comments

Functional no-op.

PS: some more, coming soon..

---------

Co-authored-by: Daniel Harvey <danieljamesharvey@gmail.com>
V3_GIT_ORIGIN_REV_ID: 37e9fe19eda82437037bbed526f023db2992772a
2024-05-16 07:55:08 +00:00
Daniel Harvey
b0128d816c Rename boolean_expressions stage to object_boolean_expressions stage (#584)
<!-- Thank you for submitting this PR! :) -->

## Description

There is soon to be an actual `boolean_expressions` stage so let's make
this other one clearly separate. Functional no-op.

V3_GIT_ORIGIN_REV_ID: c7cbcf10dfa68bac9ba70394566b4e89f82e7742
2024-05-16 06:58:48 +00:00
Daniel Harvey
79a3950b08 Use object type from data connector schema response (#582)
<!-- Thank you for submitting this PR! :) -->

## Description

In future we won't have `data_connector_object_type` available in
boolean expressions, so let's stop our dependency on it.

Also includes a couple of quality of life changes to make dealing with
NDC schema responses easier (we put them into `BTreeMap`s keyed by their
`FunctionName`, `ProcedureName`, etc.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 6d265969363fa676b24f5e78ce3f8b5dde399251
2024-05-15 10:29:52 +00:00
Anon Ray
1d7666f18e add back removed function in #580 (#583)
Add back removed function (`does_contain_error`) in #580

V3_GIT_ORIGIN_REV_ID: f1a1c04896ce63d07d88ae91f11c9468bdd47aaa
2024-05-15 09:57:10 +00:00
Daniel Harvey
7ce858cec9 fix remote joins nested inside local joins (#565)
## Description

Fixes https://hasurahq.atlassian.net/browse/V3ENGINE-134

The problem is caused by a local relationship with multiple remote joins
inside. The `not_nested` case passes, but `nested` and `very_nested`
fail.

The root cause of the problem was wrong assumption in the collecting of
join arguments code. This PR fixes it, and also refactors the remote
joins execution code to make it easier (hopefully) to follow .

---------

Co-authored-by: Anon Ray <rayanon004@gmail.com>
Co-authored-by: Anon Ray <ecthiender@users.noreply.github.com>
V3_GIT_ORIGIN_REV_ID: 52f5449261406da51a3a6ea7d96d1b166220e8fe
2024-05-14 16:14:19 +00:00
Samir Talwar
cc8bdcc560 Add support for HTTP/2 to the custom connector. (#581)
Enable HTTP/2 support for Axum, so that we can make use of request
multiplexing from the engine in the future.

I also added an `env_logger` to the custom connector so we can see
what's going on there.

V3_GIT_ORIGIN_REV_ID: 3082b988ae3d149ee548f94638308876734b26df
2024-05-14 15:11:28 +00:00
Samir Talwar
082e2be70d Remove intermediate conversions to JSON for responses. (#580)
`axum::Json` can work with any serializable type. Constructing a
`serde_json::Value` using `json!` just adds an intermediate step,
slowing down the conversion from structured data to the response bytes.

V3_GIT_ORIGIN_REV_ID: 8ae6352cb9a576988df5bf417e78d64706c7eb6e
2024-05-14 14:41:21 +00:00
Samir Talwar
e7ce80069e Add more spans around calls to NDC. (#578)
This adds three new spans so we can understand what's going on when we
talk to a connector:

1. A span around constructing the request, so that if serializing the
request body takes a long time, we can see it.
2. An extra span around the request itself, to separate it out.
3. A span around deserializing the response from JSON.

All spans are internal.

V3_GIT_ORIGIN_REV_ID: c5b2630cfc52b05aa6cd1dd65ad14aa1aa86d873
2024-05-14 12:25:34 +00:00
Anon Ray
542094e95a add a default admin header in local dev graphiql (#577)
## Description

Every time I open up GraphiQL, I have to manually add a role header.
Let's default it to admin. And one can override it on the GraphiQL UI.

V3_GIT_ORIGIN_REV_ID: 58a4720177eb90ddc7fa5e1f1763a8509873283f
2024-05-14 09:47:09 +00:00
Samir Talwar
891cfec3a6 Remove redundant conversions to serde_json::Value. (#579)
There are a couple of places where we serialize a `serde_json::Value` to
itself. This is completely unnecessary and quite time-consuming.

V3_GIT_ORIGIN_REV_ID: f15e606fb935f41d280820531e1111d150950a05
2024-05-14 09:32:10 +00:00
Samir Talwar
83e407982a Convert trace display names once. (#576)
There's no reason to go through `String`; we want an
`opentelemetry::Value`, and we shall get it.

Accepting anything that converts from `opentelemetry::Value` is also
more optimal in the case of a `&'static str`; when we have one, nothing
is cloned.

V3_GIT_ORIGIN_REV_ID: edbbf93666b15d714b95dedeb3adbcece93626fc
2024-05-14 08:03:57 +00:00
Samir Talwar
d3f844b54d Use syn v2 in our own macros. (#574)
This upgrades `darling` and `schemars` too, so they also use `syn` v2.

V3_GIT_ORIGIN_REV_ID: 731160389115dfa079fb1e13e831204d278f5a40
2024-05-14 07:50:49 +00:00
dependabot[bot]
65ee1d8549 Bump expect-test from 1.4.1 to 1.5.0 (#571)
V3_GIT_ORIGIN_REV_ID: b85e7346211b3e2f647974ca9d95661a412df00e
2024-05-13 13:29:28 +00:00
dependabot[bot]
fa8bbc5c1e Bump opentelemetry-http from 0.11.0 to 0.11.1 (#570)
V3_GIT_ORIGIN_REV_ID: 640702b99717dc86587a0e48798df27d85014c5a
2024-05-13 13:13:54 +00:00
dependabot[bot]
ba43f6c8ef Bump async-graphql-parser from 7.0.3 to 7.0.5 (#572)
V3_GIT_ORIGIN_REV_ID: 7550ef5800612f95715c49b722db8885e9b251b4
2024-05-13 12:53:23 +00:00
dependabot[bot]
6837b08251 Bump serde from 1.0.197 to 1.0.201 (#569)
V3_GIT_ORIGIN_REV_ID: 7a11540a7b365ac4e352dd98fa3c1ad8e7ee8f1c
2024-05-13 12:38:03 +00:00
Daniel Harvey
6710a5cf78 Replace HashMap / HashSet with BTreeMap / BTreeSet in metadata-resolve (#568)
<!-- Thank you for submitting this PR! :) -->

## Description

We're adding some tests that compare the output of metadata resolve.
Unfortunately, the results are nondeterministic because we use `HashMap`
/ `HashSet` in a lot of places. This replaces those uses with `BTreeMap`
and `BTreeSet` in `metadata-resolve`, and in a few places in `schema`
that rely on those types.

Some light reading around suggests that as well as giving us consistent
ordering, `BTree-` versions are better in terms of memory usage, esp
with < 1000 items (which I'm pretty sure most metadata items are)

https://www.reddit.com/r/rust/comments/xbkuc7/btreemap_vs_hashmap/
https://users.rust-lang.org/t/hashmap-vs-btreemap/13804/2
https://iq.opengenus.org/hashmap-and-btreemap-rust/

Functional no-op.

V3_GIT_ORIGIN_REV_ID: dbf49aefef0cd7084a3a37ef4fe9fc61257e1305
2024-05-13 11:04:35 +00:00
Daniel Harvey
0e2eb62874 Rename boolean_expression_type to object_boolean_expression_type (#567)
<!-- Thank you for submitting this PR! :) -->

## Description

There is about to be a separate thing called `boolean_expression_type`,
so let's have a nice time and make the two things explicitly different.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 0035e39a2ca8657a6ded5d5f0a4f284c3e72126d
2024-05-10 12:29:07 +00:00
Daniel Harvey
42b1a63484 Replace mutation in remote joins with more explicit return types (#566)
Found some of the remote join argument collection a little tricky to
follow, so changed it to be a little more explicit. It is still broken
for nested remote joins inside local ones, but at least is more explicit
about it's behaviour regarding returning joins.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 77d4717ee9d5effc1c08bcf5f4fbcf0af9f5d777
2024-05-10 12:29:01 +00:00
Philip Lykke Carlsen
c6513f6887 Add CORS layer last (#564)
## Description

This PR adds the CORS layer last, as it otherwise does not affect the
/metadata endpoint.

V3_GIT_ORIGIN_REV_ID: 77792d6bc35fe7e1df4191c834026f5c8a335bb3
2024-05-10 12:28:54 +00:00
Abhinav Gupta
5d1f9938e2 nest is_null and logical operator configuration in OpenDD expressions RFC (#562)
Tiny change to the RFC to allow for _is_null / _and / _or / _not field
renaming per-type in the future.

V3_GIT_ORIGIN_REV_ID: e090b300f804d72fe2127a5d769e12b89af44f7b
2024-05-10 12:28:48 +00:00
Rakesh Emmadi
f6ebaf345a enable CORS in engine server (#560)
<!-- Thank you for submitting this PR! :) -->

## Description

JIRA: https://hasurahq.atlassian.net/browse/V3ENGINE-135
Introduce an option to enable CORS in engine's single tenant server.
- `--enable-cors` CLI flag or `ENABLE_CORS=true` env var to support
preflight CORS request and include relevant headers in responses.
- `--cors-allow-origin` CLI option or `CORS_ALLOW_ORIGIN=` env var that
accepts comma-separated list of allowed origin domains.

<!--
  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)_

- [ ] community-edition
- [ ] 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
- [ ] 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
-->

_Replace with changelog entry_

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

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

---------

Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: d562cde28898416cfbfd00ffd97e7b668ff3c953
2024-05-10 12:28:41 +00:00
Samir Talwar
e6d1f5785e Avoid using the internals of schemars. (#561)
The internals of `schemars` has recently changed, removing
`schemars::_private::apply_metadata`. We should not be using this
function. I have rewritten the code to modify the metadata through the
public API instead.

I have not actually bumped the version of schemars in this change; we
can do that separately.

V3_GIT_ORIGIN_REV_ID: 84a7d39cbd586d8486ae18f47ddc0a51270b8628
2024-05-10 12:28:35 +00:00
Rakesh Emmadi
134f48a7f1 Contributing guide for error management in Rust (#554)
Add a document that lays down some recommendations around design and
usage or error types in Rust code.

V3_GIT_ORIGIN_REV_ID: 3b2489bf632c96abcac0cd0966a675aa1e15e1bc
2024-05-10 12:28:28 +00:00
Daniel Harvey
de342fb2bf Split schema into own crate (#556)
<!-- Thank you for submitting this PR! :) -->

## Description

This PR splits the GraphQL schema generation into the `schema` crate.
Functional no-op.

V3_GIT_ORIGIN_REV_ID: 4f1a91387305d88e9b5fbe4bc8df0575292cf878
2024-05-10 12:28:22 +00:00
Daniel Harvey
35c58f0000 Use argument_mapping when resolving remote relationships to commands (#557)
<!-- Thank you for submitting this PR! :) -->

## Description

When trying to reproduce a remote relationships bug, I managed to find
this bug where remote relationships to commands ignore the argument
mappings. A command argument can be called one thing in the NDC itself
(ie, `id`), but we might want to expose it as `actor_id` in the engine
as that's nicer for the user. As we referred to everything with
`String`, we did not convert back to the NDC argument name when sending
information from a remote relationship, this PR fixes that.

We also add a `ConnectorArgumentName` newtype which replaces a bunch of
uses of `String`, and would have guided us towards not creating this bug
in the first place.

<!--
  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
- [ ] enhancement
- [X] 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
-->

Fix to correctly use argument mappings when resolving remote
relationships to commands.

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

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

V3_GIT_ORIGIN_REV_ID: 2219e50d6cb28456e60c6794dc163d9b90573f8e
2024-05-10 12:28:15 +00:00
Anon Ray
1130e271c7 add some newtypes to remote_joins::types (#558)
## Description

Add some newtype wrappers around existing types in remote joins.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: dbd11eb30d48fc7aafd30604fc18e124d15b59ba
2024-05-10 12:28:08 +00:00
Daniel Harvey
afa93c6b35 Move utils into json_ext crate (#555)
<!-- Thank you for submitting this PR! :) -->

## Description

We'd like to split the engine into smaller crates where possible, to
enforce boundaries better. The next step is splitting `schema`, but it
uses things in `engine/utils`. This splits those utils into a `json_ext`
package, as they all seem like JSON helpers.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 44d93a7346dc83194abaa46158be2b8401905bd0
2024-05-10 12:28:01 +00:00
Daniel Harvey
c5151fb3cb Resolve relationships in type predicates (#536)
<!-- Thank you for submitting this PR! :) -->

## Description

We have a separate copy of the code for resolving type predicates that
we use for object types (when resolving BooleanExpressions), because the
previous code was heavily tied to the Model it used. We'd like to unify
that code again, so the first step is re-implementing relationships in
`resolve_model_predicate_with_type`.

<!--
  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 boolean expressions to use relationships

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

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

V3_GIT_ORIGIN_REV_ID: 6225a4ab752b71df3cdfd0982bf2107ca39f4940
2024-05-10 12:27:55 +00:00
Daniel Harvey
ce4dd596fb Add instructions for using the Nix Flake (#547)
<!-- Thank you for submitting this PR! :) -->

## Description

We maintain a Nix Flake for installing project dependencies but do not
advertise or explain it. Hopefully this fixes that.

---------

Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: f1c5d471a5d1ffd5fa3ef31a471da7fcc44a935b
2024-05-10 12:27:48 +00:00
dependabot[bot]
085277491c Bump goldenfile from 1.6.0 to 1.7.1 (#552)
V3_GIT_ORIGIN_REV_ID: 68a37111246c8a923a9e881f5bb944b770b17d8c
2024-05-10 12:27:41 +00:00
dependabot[bot]
882b907235 Bump serde_json from 1.0.115 to 1.0.116 (#553)
V3_GIT_ORIGIN_REV_ID: 8ca39537cca63e86b1a350f484c351093418467f
2024-05-10 12:27:34 +00:00
dependabot[bot]
c5fc05b8c2 Bump serde_with from 2.3.3 to 3.8.1 (#549)
V3_GIT_ORIGIN_REV_ID: 73f08cd518591be471b8825dbb84d368c45f5f2c
2024-05-10 12:27:27 +00:00
dependabot[bot]
3188a61e60 Bump base64 from 0.22.0 to 0.22.1 (#551)
V3_GIT_ORIGIN_REV_ID: 5cebb181c8edd4dc539ce7166156cc9a2d6c47a4
2024-05-10 12:27:20 +00:00
dependabot[bot]
d0ea246d8d Bump async-recursion from 1.1.0 to 1.1.1 (#550)
V3_GIT_ORIGIN_REV_ID: cc078462ec7713139875b0991e86f670d81b7ae6
2024-05-10 12:27:13 +00:00
Abhinav Gupta
e891998ba2 RFC for OpenDD expression type changes (#511)
RFC for OpenDD expression type changes

Proposes many changes to scalar type comparison expressions, object
boolean expressions, and model order by expressions to be consistent and
robust to all possible object type structures.

[Rendered](https://github.com/hasura/v3-engine/blob/open_dd_expression_type_changes/rfcs/open-dd-expression-type-changes.md)

V3_GIT_ORIGIN_REV_ID: ac9134ac7713de087f07d08d39d9ca67ee6ef86f
2024-05-03 15:53:05 +00:00
Daniel Harvey
f6220cad37 Explicitly export types from schema module (#548)
<!-- Thank you for submitting this PR! :) -->

## Description

As per [similar changes in metadata
resolve](https://github.com/hasura/v3-engine/pull/527/files#diff-9c8df6114296efea5aa2e5bf31762d5b1db14165504cd15b96d5022551065921R1),
this makes the `schema` module explicitly export everything other
modules need. This means we should also be able to pull it into it's own
crate.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: a0840116d82316aa9e89a6e2197cef76e961f572
2024-05-03 14:20:18 +00:00
Daniel Harvey
aae750ae92 Remove Option from ModelWithPermissions (#529)
<!-- Thank you for submitting this PR! :) -->

## Description

Much as per https://github.com/hasura/v3-engine/pull/524 for
`CommandWithPermission`, this removes the `Option` from
`ModelWithPermissions`. Again, select permissions are opt-in, so
`Some(HashMap::new())` is the same as `None`, so we can remove this
layer of indirection, which I believe was only there because we were
building up the `Model` type incrementally.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: fcb6479f32b001380ae24db6439e96339a868692
2024-05-03 13:20:31 +00:00
Gil Mizrahi
66990c0d91 use a newtype for data connector object type (#542)
## Description

Introduce a newtype for data connector object type for the added
context.

V3_GIT_ORIGIN_REV_ID: b499d3a9cd2610fec05a4bc2e1b3cf522f198b9c
2024-05-03 09:33:15 +00:00
Daniel Harvey
5fe266ca01 Boolean expressions in command argument presets (#539)
<!-- Thank you for submitting this PR! :) -->

## Description

This PR enables boolean expressions in command argument presets. This
allows users to provide an expression to do things like "when the `user`
role runs the `deleteUser` command they can only delete users with `id`
== `x-hasura-user-id`".

It's up to the data connector to interpret the expression as it sees
fit.

<!--
  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 using boolean expressions in command arguments.

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

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

V3_GIT_ORIGIN_REV_ID: 302f62a266db9c090ba232fe9ab06db4953f38a6
2024-05-03 08:12:35 +00:00
Daniel Harvey
e3c0cb4e1a Use Postgres in readme (#546)
<!-- Thank you for submitting this PR! :) -->

## Description

The getting starting instructions for Docker don't work because they use
the reference agent sample metadata from `open-dds` crate. I managed to
get the metadata building but for some reason I get connection errors
when running the queries (cannot reach the reference agent).

I would like to investigate this further, but in the meantime, this
updates the readme to use the metadata from the tests, which should at
least get them up and running with a working GraphiQL / Jaeger.

V3_GIT_ORIGIN_REV_ID: d0dc81560a068b960104228f89ee7e7d483a58d9
2024-05-02 21:40:37 +00:00
Daniel Harvey
7dfb9d1a1f Build dev-auth-webhook Docker image with Nix (#544)
<!-- Thank you for submitting this PR! :) -->

## Description

We'd like to speed up creation of all these Docker images, so this adds
`dev-auth-webhook` to the Nix flake. Functional no-op.

---------

Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: 384eb467b2fe7fba1644f5b4cc6224cdc043ce01
2024-05-02 14:23:28 +00:00
Samir Talwar
20514ab580 Remove unused Display implementations and fix a broken one. (#545)
There were multiple locations where we were implementing
`derive_more::Display` with a fixed format string, mostly of
`"Display"`. This means that the `to_string` implementations of those
types would just return `"Display"`, which is quite unhelpful.

In all cases but one, I was simply able to remove the implementation.

In the last case, `QualifiedTypeReference` had a broken implementation.
I replaced it with something more meaningful: the type name, followed by
a `"!"` if the type is non-nullable. `derive_more` was unable to help me
here so I implemented it the old-fashioned way. (I think replacing it
with an `enum` could also work.)

V3_GIT_ORIGIN_REV_ID: 35cf573d1efab2bba0707b248ae8b74bd535d0ed
2024-05-02 13:59:36 +00:00
Gil Mizrahi
690711ea1e add some code comments to resolved stage (#537)
## Description

Checking my understanding by documenting some stuff. Today it is
resolved/graphql_config, which lets us change the names of hasura
features in the syntax of the graphql.

---------

Co-authored-by: Daniel Harvey <danieljamesharvey@gmail.com>
Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: a7053e610a1f310dfc9bab2a31e79e7b0e5110c3
2024-05-02 13:35:17 +00:00
Daniel Harvey
11240e2bff Split metadata-resolve into own crate (#543)
<!-- Thank you for submitting this PR! :) -->

## Description

Now that metadata resolve has a clear interface with the rest of the
engine, let's take it out into it's own crate. This will make it easier
to maintain a strong boundary between things.

To simplify imports etc, removed nested layers of modules, so now we
import `use metadata_resolve::Qualified` instead of `use
crate::metadata::resolved::Qualified`.

The changes in `engine` crate are all just updating imports.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: fb94304f7ed8883287c18bd6870045dfd69e3fe3
2024-05-02 12:29:22 +00:00
Daniel Harvey
3f74f2e93d Move annotation type back into metadata resolve (#540)
<!-- Thank you for submitting this PR! :) -->

## Description

We'd like to split metadata resolve into it's own crate to enforce
module boundaries better. In doing so, discovered that it's using a type
from the later schema stage called `PredicateRelationshipAnnotation`,
which isn't really an annotation type at all, just a data structure for
a resolved predicate.

This moves that types back into metadata resolve, renaming it to
`PredicateRelationshipInfo`.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 5b37ca77fb4ddf17093277e6727360d6077c4e06
2024-05-02 09:17:41 +00:00
Gil Mizrahi
fbe6e1c263 add format step after update goldenfiles (#541)
## Description

When regenerating goldenfiles, all tests formatting go out of order.
This adds a subsequent formatting step afterwards.

V3_GIT_ORIGIN_REV_ID: 5cddd4cc4ec6c1d684b1841be9347f1fcaa3aade
2024-05-02 08:43:58 +00:00
Rakesh Emmadi
7944fdbe4e Refactor errors, and split execute and explain code path (#525)
The massive `Error` enum from `execute.rs` disintegrates into the
following independent error types.
- `RequestError`: All exceptions occurred before executing the root
field plans. Each variant in this error enum contains the error type
stemming from isolated steps in the pipeline involving parsing,
validation, IR conversion, and plan generation.
- `FieldError`: Exception occurred when resolving a field through its
plan. Multiple root fields are executed isolated, and field errors are
collected in a list.

Code paths for `explain` and `execute` query are split into two
functions. This is done to avoid few error variants and unburden the
function that previously does both.

V3_GIT_ORIGIN_REV_ID: 21f2f43ee4805a955fa0ce7d9b45c4b1902def63
2024-05-02 07:29:06 +00:00
Daniel Harvey
4f2a29b9cf rename data_connector_type_mappings stage to object_types (#533)
<!-- Thank you for submitting this PR! :) -->

## Description

We named this stage after the least interesting thing about it, this
resolves that.

`data_connector_type_mappings` -> `object_types`.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 67c94356cc7207e94eb3b696abbd32efe31551ac
2024-05-01 11:03:57 +00:00
Daniel Harvey
ba5d0e3e8f Fix dev-auth-webhook Docker image, build all in CI (#535)
<!-- Thank you for submitting this PR! :) -->

## Description

I think this broke when moving folders around, realised we weren't even
building it other than in `main`, this rectifies that.

V3_GIT_ORIGIN_REV_ID: f822290f9a00159d4b1b55553f31175b697a16c1
2024-05-01 09:54:14 +00:00
Daniel Harvey
b9a29c3e1d Include data_connector_type_mappings along with object_types. (#532)
<!-- Thank you for submitting this PR! :) -->

## Description

`data_connector_type_mappings` is a map of data connector information
keyed by `CustomTypeName`. We create it when we resolve object types,
which are also keyed by `CustomTypeName`, however we pass them around
separately and it's not immediately obvious that they are related.

This PR stops passing `data_connector_type_mappings` around and instead
includes them with the object information.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 3ac1341907ea88c11fbc3639adf63140aa702262
2024-05-01 09:25:44 +00:00
Gil Mizrahi
0323da8144 create auth and utils subdirectories in crates, and move architecture information to a separate doc. (#534)
## Description

1. I've moved the architecture information we had in `CONTRIBUTING.md`
to a separate document `docs/architecture.md` so we can evolve both
separately in the future.
2. I've introduced a couple of sub directories: `utils` and `auth`, for
supporting crates that are not the core functionality of the engine so
it is easier to find the most relevant crates.

New structure:

```
crates
├── auth
│   ├── dev-auth-webhook
│   ├── hasura-authn-core
│   ├── hasura-authn-jwt
│   └── hasura-authn-webhook
├── custom-connector
├── engine
├── lang-graphql
├── metadata-schema-generator
├── open-dds
└── utils
    ├── opendds-derive
    ├── recursion_limit_macro
    └── tracing-util
```

V3_GIT_ORIGIN_REV_ID: e0e9394da2fcd911f329c48107a76f8492fa304c
2024-05-01 09:05:15 +00:00
Samir Talwar
c4b659e12c Rename "source" to "sourceType" for "kind": "Relationship". (#531)
## Description

To clarify the purpose of the `"source"` field, we've decided to rename
it to `"sourceType"`. This hopefully makes it clearer that the value
should be a type name.

`"source"` is still accepted as an alias in order to stop this from
being a breaking change.

I have added the aliasing capability for struct fields in
`opendds_derive`.

All test metadata has been updated to use `"sourceType"`, but I've added
one test case that uses `"source"` instead just to make sure that it
still works.

## 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
- [ ] enhancement
- [ ] bugfix
- [x] 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
-->

- OpenDDS: The `"source"` field for relationships has been renamed to
`"sourceType"`. Metadata using `"source"` will continue to work as
usual, but new metadata should be authored with `"sourceType"` instead.

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

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

V3_GIT_ORIGIN_REV_ID: 305cbf7a62ee49a715e95ad892b8d00647f05cef
2024-04-30 17:21:07 +00:00
Samir Talwar
ca61619c06 Format everything with Prettier. (#530)
I found myself wanting to rewrite JSON files with `sed`. The problem is,
then I want to run a formatter over them afterwards, and this will
change the whole file, not just the area I touched.

I would like to propose the nuclear option in remedying this: format
everything now. This is a very large change that should make it easier
to keep files to a consistent format in the future.

I have chosen to use Prettier for this because (a) it has a useful
`--write` command and (b) it also does GraphQL, Markdown, YAML, etc.

I've elected to exclude two sets of files:

1. `crates/custom-connector/data/*.json`, because they are actually
multiple JSON objects, one per line, which Prettier cannot parse.
2. `crates/lang-graphql/tests/**/*.graphql`, because it contains invalid
GraphQL, and the parser is intended to work with strangely-formatted
GraphQL.

The main changes are standardizing whitespace, adding a newline at the
end of files, and putting JSON arrays on one line when they fit.

V3_GIT_ORIGIN_REV_ID: 92d4a535c34a3cc00721e8ddc6f17c5717e8ff76
2024-04-30 14:58:57 +00:00
Samir Talwar
a1d6aa49c0 opendds-derive: Avoid panicking when unknown properties are encountered. (#528)
By wrapping the errors we can work with both `syn` and `darling` errors,
allowing us to avoid `.unwrap` and `.expect`. This makes failures way
more useful.

V3_GIT_ORIGIN_REV_ID: bd7c4a4e7de4a2360b4533d9238199f098a09a8d
2024-04-30 13:59:40 +00:00
Daniel Harvey
774bf78786 Tidy up metadata resolve (#527)
<!-- Thank you for submitting this PR! :) -->

## Description

This stacks on top of https://github.com/hasura/v3-engine/pull/526 and
is the tidying up step following it.

There is a lot going on here, none of it particularly interesting.

- We remove the old `resolve_metadata` function, so all of "the action"
for resolving metadata happens inside `resolved::stages::mod`.
- We move the remaining modules into two folders, `helpers` and `types`.
This is a pretty rough cut, and there are definitely better homes for
the things here, I just wanted the separation of stages and "other bits"
to be clearer.
- We split the `types` helpers into `types` and `type_mappings`, as the
`type_mappings` stuff was clearly defined and didn't belong with the
grab-bag of functions that remain in `types`.
- We explicitly export everything used outside metadata resolve, and
stop other modules dipping into it's internal structure. This will make
future changes (particularly refactors that change the stages etc) a lot
easier as we don't need the rest of the app concerning itself with it.
- I _think_ we may now be able to move metadata resolve into a separate
crate. I have not tried yet, this PR is already silly enough.

When given a choice between "fixing" something, and doing the most
mechanical obvious change, I have opted for the latter. That is to
derisk this big change, and to ensure it doesn't linger, collecting
awful merge conflicts.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 2b52403cbfddb0427b8a3e61ad2edaef9d1b3b46
2024-04-30 10:56:28 +00:00
Daniel Harvey
9046cc45b4 Separate model_permissions resolve step (#526)
<!-- Thank you for submitting this PR! :) -->

## Description

Following work in https://github.com/hasura/v3-engine/pull/523 and
friends, this resolves `model_permissions` in a fresh step, creating a
new `ModelWithPermissions` type to differentiate from the regular
`Model` which no longer has any notion of permissions.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: fdf928ae12159a6c4ef87effc4704193c5306e46
2024-04-30 10:35:12 +00:00
Daniel Harvey
4b7aa437f0 Remove Option from resolved command permissions (#524)
<!-- Thank you for submitting this PR! :) -->

## Description

Follow up to https://github.com/hasura/v3-engine/pull/523

This removes the `Option` from the Command permissions. Seperated from
the pure "moving things around" PR for clarity, it should be a
functional no-op though, as Command permissions are opt-in, so `None`
and `Some(HashMap::new())` are equivalent, and this layer can be
removed.

V3_GIT_ORIGIN_REV_ID: ebd8fbb54c0f771b7128ff499af2abea85f73808
2024-04-30 07:49:02 +00:00
Daniel Harvey
3e8e6add11 Separate command_permissions resolve step (#523)
<!-- Thank you for submitting this PR! :) -->

## Description

Following https://github.com/hasura/v3-engine/pull/522 and friends, this
breaks out the command permissions into a discreet metadata step. This
creates a new `CommandWithPermissions` with type which is available
after this step, and removes the `Option<CommandPermission>` from the
regular `Command` type.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: ac076a93257d25ec5f9367a5a0b280f8b63371fc
2024-04-29 16:59:37 +00:00
Daniel Harvey
847f81ad96 Separate relationships resolve stage (#522)
<!-- Thank you for submitting this PR! :) -->

## Description

This separates out the stage that resolves relationships. The most
important thing here is that we no longer have a `relationships` field
in `ObjectTypeRepresentation` that may or may not be populated, and
instead add a new wrapper type `ObjectTypeWithRelationships`, which is
used downstream of this stage.

Stacked on top of https://github.com/hasura/v3-engine/pull/521

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 1e6ca41e55b8cc470385c35bbd7999fa7a2bce6e
2024-04-29 14:57:27 +00:00
Daniel Harvey
b1149c26de A few more loose metadata stages (#521)
<!-- Thank you for submitting this PR! :) -->

## Description

Following https://github.com/hasura/v3-engine/pull/520, there are a
couple of loose things that occur in the big metadata resolve, given
them their own stages too. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 2b7454ce997411da7dd9551ac05a4180b137e0a0
2024-04-29 14:41:54 +00:00
Daniel Harvey
569fec0e4c Separate commands metadata resolve stage (#520)
<!-- Thank you for submitting this PR! :) -->

## Description

Following https://github.com/hasura/v3-engine/pull/519 here is the
equivalent change for `commands` which are fortunately, much simpler.
Functional no-op.

V3_GIT_ORIGIN_REV_ID: 24ec7107018ed29e251452c9ca19c5b0538cd0c6
2024-04-29 13:22:38 +00:00
Daniel Harvey
8a9bfaaa6b Separate models metadata resolve step (#519)
<!-- Thank you for submitting this PR! :) -->

## Description

As per https://github.com/hasura/v3-engine/pull/483 and all PRs
proceeding it, this moves the resolving of Models into a discreet
metadata stage. The `resolve::model` module was a bit of a dumping
ground, so I have tried to find more sensible homes for a lot of things,
but some things remain (model permissions) and will be homed when
sorting later stages.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: b41bcc9f413a867f21dd72b5d7affee8d55e02df
2024-04-29 12:54:22 +00:00
dependabot[bot]
0eb062d168 Bump strum_macros from 0.25.3 to 0.26.2 (#514)
V3_GIT_ORIGIN_REV_ID: 11e583559b0143e8fa7056a39c98c20fff6bb83e
2024-04-29 10:11:26 +00:00
dependabot[bot]
2649b443f4 Bump apollo-parser from 0.4.1 to 0.7.7 (#517)
V3_GIT_ORIGIN_REV_ID: 13f05ec1a9a909c3b713b99df08a6d169a1b3a3a
2024-04-29 08:47:57 +00:00
dependabot[bot]
31a1d7127d Bump proc-macro2 from 1.0.79 to 1.0.81 (#516)
V3_GIT_ORIGIN_REV_ID: 67c49e71d071d272da37e0a8e1c34ac36423f64d
2024-04-29 08:31:10 +00:00
dependabot[bot]
8dc66fa758 Bump cookie from 0.17.0 to 0.18.1 (#515)
V3_GIT_ORIGIN_REV_ID: 40af3675b9c3a230d7e70148797ce28e5b1e85cc
2024-04-29 08:14:57 +00:00
Daniel Harvey
6b826ef41d Move boolean expressions into own metadata resolve stage (#512)
<!-- Thank you for submitting this PR! :) -->

## Description

More metadata resolving into stages, this time the resolving of boolean
expressions. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 5b74f7cd17f919dc54b82c003b7dd937eb69b65e
2024-04-26 15:00:37 +00:00
Daniel Harvey
6a791bc913 resolve predicates in the context of types (#444)
<!-- Thank you for submitting this PR! :) -->

## Description

This implements the first part of passing boolean expressions as command
arguments. It adds a `BooleanExpression` arm to `ValueExpression`, and
allows them to be resolved in the context of an ObjectType rather than
an entire model.

This means that if a boolean expression is passed to a command argument
that uses a field that doesn't exist, this happens:

<img width="960" alt="Screenshot 2024-04-05 at 15 54 20"
src="https://github.com/hasura/v3-engine/assets/4729125/cd795bc1-9fda-4cfb-bad3-1e70dd6227a0">

The output of this PR is that we can resolve metadata for boolean
expressions in command arguments, and generate a GraphQL schema for
them, but will throw an error if one is actually used. This will be
resolved in the follow-up PR.

V3_GIT_ORIGIN_REV_ID: 20b8840c313d7ee1f56ebd5becdb28bbe7743350
2024-04-26 14:06:12 +00:00
Daniel Harvey
c8e6efdc4e Remove data_connector from metadata step (#509)
<!-- Thank you for submitting this PR! :) -->

## Description

As part of moving types and functions into resolve stages, this gets rid
of the root-level `data_connector` module and moves it's types into
`data_connectors` and `data_connector_scalar_types` as appropriate.
Functional no-op.

V3_GIT_ORIGIN_REV_ID: 3109cc17931f0db42c7a4448c6d6194033f700e4
2024-04-26 09:11:31 +00:00
Daniel Harvey
4ea88180d7 create Docker images with Nix (#507)
<!-- Thank you for submitting this PR! :) -->

## Description

In order to test things quicker, we'd like to be able to build custom
connector and friends in Nix, and then use the containers when running
tests. First step here is to be able to build Docker containers in Nix,
and add a CI job to ensure it still works.

Then we'll move onto publishing and using these images.

No-op build times:

<img width="336" alt="Screenshot 2024-04-25 at 15 53 56"
src="https://github.com/hasura/v3-engine/assets/4729125/47cbc0c5-6e54-4583-aa01-0528d4a21080">

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 8f9d609e26cdd3b0801e61fd361c241ad504dcdf
2024-04-26 08:44:04 +00:00
Daniel Harvey
d8846328c4 Move TypeMapping and FieldMapping to data_connector_type_mappings stage (#510)
<!-- Thank you for submitting this PR! :) -->

## Description

As everything is taking shape we're finding more loose bits and pieces
around, this moves `TypeMappings` and `FieldMappings` into the
`data_connector_type_mappings` stage. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 2357e47b68d361b373f9fa886683ceb1fcff7cc3
2024-04-26 08:04:40 +00:00
Daniel Harvey
9d25ee2075 Add time limits on generate_ir benchmarks too (#508)
<!-- Thank you for submitting this PR! :) -->

## Description

I wondered why some benchmarks were very quick seconds and others very
slow (hours). Turns out I only told half of them that I would prefer
them to be fast. Rectified.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 40bbcc6829e9a4ea85058f2983136024a9971e3b
2024-04-25 15:43:52 +00:00
Daniel Harvey
746b18c9c4 Rename get_underlying_object_type (#506)
<!-- Thank you for submitting this PR! :) -->

## Description

The function changed, the name did not, now it makes no sense. Also it's
friend wasn't even used anymore. Functional no-op.

V3_GIT_ORIGIN_REV_ID: 626316acd06f15d89e504365d21131177a41dada
2024-04-25 08:37:59 +00:00
Daniel Harvey
89812dd1ee Bump Criterion lib (#504)
<!-- Thank you for submitting this PR! :) -->

## Description

Benchmarks are running pretty slowly in Github, let's check it's not an
old library version problem.

---------

Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: db1a70c5465cf475fa66d2afc981fd496eccacaa
2024-04-24 15:53:42 +00:00