mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-16 01:44:03 +03:00
93d608c1ab
13 Commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
Daniel Harvey
|
2a24b3060a |
use clippy settings in Cargo workspace (#441)
<!-- Thank you for submitting this PR! :) --> ## Description Following the approach taken here: https://github.com/hasura/ndc-postgres/pull/402 This moves the `clippy` settings into the Cargo workspace file instead of passing them for each invocation. We enable all pedantic settings, run `cargo clippy --fix` to auto fix a few things, and then manually disable all other lints. Plenty of them are worth enabling and fixing in future IMO. --------- Co-authored-by: Samir Talwar <samir.talwar@hasura.io> V3_GIT_ORIGIN_REV_ID: aa0e6ccb8d72a7393e14b5c58b82077a67d9cb15 |
||
Samir Talwar
|
3a1968317b |
Upgrade ndc-spec and opentelemetry, and add a traceresponse header. (#416)
<!-- Thank you for submitting this PR! :) --> ## Description I have upgraded ndc-spec to v0.1.1. This pulls in an upgrade to opentelemetry v0.22 so I've done that too. We had issues with the `traceresponse` response header disappearing when using an opentelemetry version > v0.20. This seems to be resolved here, probably because we have pinned a single version of opentelemetry rather than loading multiple at once. I added the `traceresponse` header to verify this, and have left it in because it doesn't seem to hurt anything. I verified that everything works as expected with the OSS components, but not multitenant. ## 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 --> v3 engine GraphQL queries now include a "traceresponse" header. <!-- changelog-entry : end : DO NOT REMOVE --> <!-- changelog : end : DO NOT REMOVE --> V3_GIT_ORIGIN_REV_ID: f37b6bdb1331b55c49f0bd953f522f5eca298d1d |
||
Samir Talwar
|
748bb3abab |
Remove unused dependencies using cargo machete . (#413)
`cargo machete` is a very useful tool that figures out when you aren't using a dependency. I have run this locally to remove unused dependencies. I've also added a CI job to make sure we catch these in the future. Sometimes it reports false positives, e.g. when a dependency isn't used directly but in macro-generated code (e.g. with `strum`). I have added `"ignored"` clauses to the `Cargo.toml` files where appropriate. V3_GIT_ORIGIN_REV_ID: ed015089b695cec8eeb03ce455d6dd3cd312a016 |
||
Anon Ray
|
1b4173011f |
fix empty input object types in introspection result when allowedFields for a type is empty (#412)
When there are no allowed fields for a type (via `TypePermissions`), engine creates related input object types (like `<TypeName>OrderBy`) with no fields. This results in an invalid introspection result. Client libraries fail with validation error. This PR fixes the issue. V3_GIT_ORIGIN_REV_ID: a45a56b1f503f6ab99f250884957b6fc723cf9c8 |
||
Brandon Simmons
|
c60a2e7113 |
lang-graphql: limit recursion to avoid stack overflows
This was a simple solution to prevent crashes from the cases that I was able to discover, refactored into a macro that can be used elsewhere; but I suspect there's a more idiomatic rust solution (entailing a big refactor?). There's also the stacker crate, and see also discussion here: https://hasurahq.slack.com/archives/C04PUMV4X16/p1707337409839869?thread_ts=1701302324.058369&cid=C04PUMV4X16 Note that the compiled binary was built and fuzzed with `--release`. Many discovered cases caused crashes when run into non-optimized binary (probably stack overflows but I did not look into it) V3_GIT_ORIGIN_REV_ID: 31acfc9e358c807be80ba6a5efa78ace78306291 |
||
Brandon Simmons
|
508be3a185 |
Test some parser stack overflow panic cases found through fuzzing
V3_GIT_ORIGIN_REV_ID: c9140708c7244546cfab61db2487d62abc51ad38 |
||
paritosh-08
|
0642cbadaa |
support apollo federation (part 1) (#332)
<!-- Thank you for submitting this PR! :) --> ## Description This PR adds the capability to expose _entities and _service fields. Apollo Federation uses these fields to extend types in other subgraphs using the types from a subgraph. We can now use Hasura v3 as a subgraph in an Apollo federated supergraph. To make this possible, we had to do the following metadata changes: - Add `apolloFederation` in `ObjectType.graphql`: ```yaml apolloFederation: keys: - fields: - id ``` - Add `apolloFederation` in `Model.graphql`: ```yaml apolloFederation: entitySource: true ``` - Add `apolloFederation` in `GraphqlConfig`: ```yaml apolloFederation: enableRootFields: true ``` https://github.com/hasura/v3-engine/assets/85472423/b3223c61-360a-4ed6-b8ab-b394469957ce RFC: https://github.com/hasura/graphql-engine/pull/10141/files#diff-a9f74850aca6ecad1556723e4b3c7395e59f26cd40d9de20bfef83cb9c64f028 ## 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 --> V3_GIT_ORIGIN_REV_ID: 73cb9e6c8ef4bfe64d0f0cd9ce3ccbd32e208712 |
||
Samir Talwar
|
aa11947067 |
Disable benchmarks in unit tests. (#376)
This means that we can pass arguments to the Criterion benchmarks because the test binaries do not try and run. For example, if you run this: ``` cargo bench -- --warm-up-time=1 --measurement-time=1 ``` … it will currently fail, because it will also pass these arguments to the tests. Disabling the benchmarks for the tests fixes this. V3_GIT_ORIGIN_REV_ID: 10fe0683b82c506e1a11b24ca0a0a4041e37b655 |
||
Philip Lykke Carlsen
|
b57a8f9f02 |
Guard against empty selection sets (#377)
## Description This PR adds a check which ensures that empty selection sets (i.e., selecting a field of object type (or list of object type)) in queries raise an error. ## 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 --> Ensure to reject queries with empty selection sets <!-- changelog-entry : end : DO NOT REMOVE --> <!-- changelog : end : DO NOT REMOVE --> V3_GIT_ORIGIN_REV_ID: 79049c39b58288f39ec29ecf713cc3622842d47e |
||
Daniel Harvey
|
e3bd16b5db |
Revert Bump serde_with from 2.3.3 to 3.7.0 (#381)
Reverts hasura/v3-engine#367 This is causing downstream problems in `v3-metadata-build-service`, let's roll back for now to unblock things. V3_GIT_ORIGIN_REV_ID: 3261f2f12825c8eac3353a2282b982f0f3bac80e |
||
dependabot[bot]
|
92fc015fac |
Bump serde_with from 2.3.3 to 3.7.0 (#367)
Bumps [serde_with](https://github.com/jonasbb/serde_with) from 2.3.3 to 3.7.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/jonasbb/serde_with/releases">serde_with's releases</a>.</em></p> <blockquote> <h2>serde_with v3.7.0</h2> <h3>Added</h3> <ul> <li>Implement <code>JsonSchemaAs</code> for <code>EnumMap</code> by <a href="https://github.com/swlynch99"><code>@swlynch99</code></a> (<a href="https://redirect.github.com/jonasbb/serde_with/issues/697">#697</a>)</li> <li>Implement <code>JsonSchemaAs</code> for <code>IfIsHumanReadable</code> by <a href="https://github.com/swlynch99"><code>@swlynch99</code></a> (<a href="https://redirect.github.com/jonasbb/serde_with/issues/717">#717</a>)</li> <li>Implement <code>JsonSchemaAs</code> for <code>KeyValueMap</code> by <a href="https://github.com/swlynch99"><code>@swlynch99</code></a> (<a href="https://redirect.github.com/jonasbb/serde_with/issues/713">#713</a>)</li> <li>Implement <code>JsonSchemaAs</code> for <code>OneOrMany</code> by <a href="https://github.com/swlynch99"><code>@swlynch99</code></a> (<a href="https://redirect.github.com/jonasbb/serde_with/issues/719">#719</a>)</li> </ul> <h3>Fixed</h3> <ul> <li>Detect conflicting <code>schema_with</code> attributes on fields with <code>schemars</code> annotations by <a href="https://github.com/swlynch99"><code>@swlynch99</code></a> (<a href="https://redirect.github.com/jonasbb/serde_with/issues/715">#715</a>) This extends the existing avoidance mechanism to a new variant fixing <a href="https://redirect.github.com/jonasbb/serde_with/issues/712">#712</a>.</li> </ul> <h2>serde_with v3.6.1</h2> <h3>Changed</h3> <ul> <li>Eliminate dependency on serde's "derive" feature by <a href="https://github.com/dtolnay"><code>@dtolnay</code></a> (<a href="https://redirect.github.com/jonasbb/serde_with/issues/694">#694</a>) This allows parallel compilation of <code>serde</code> and <code>serde_derive</code> which can speed up the wallclock time. It requires that downstream crates do not use the "derive" feature either.</li> </ul> <h2>serde_with v3.6.0</h2> <h3>Added</h3> <ul> <li>Add <code>IfIsHumanReadable</code> for conditional implementation by <a href="https://github.com/irriden"><code>@irriden</code></a> (<a href="https://redirect.github.com/jonasbb/serde_with/issues/690">#690</a>) Used to specify different transformations for text-based and binary formats.</li> <li>Add more <code>JsonSchemaAs</code> impls for all <code>Duration*</code> and <code>Timestamp*</code> adaptors by <a href="https://github.com/swlynch99"><code>@swlynch99</code></a> (<a href="https://redirect.github.com/jonasbb/serde_with/issues/685">#685</a>)</li> </ul> <h3>Changed</h3> <ul> <li>Bump MSRV to 1.65, since that is required for the <code>regex</code> dependency.</li> </ul> <h2>serde_with v3.5.1</h2> <h3>Fixed</h3> <ul> <li>The <code>serde_as</code> macro now better detects existing <code>schemars</code> attributes on fields and incorporates them by <a href="https://github.com/swlynch99"><code>@swlynch99</code></a> (<a href="https://redirect.github.com/jonasbb/serde_with/issues/682">#682</a>) This avoids errors on existing <code>#[schemars(with = ...)]</code> annotations.</li> </ul> <h2>serde_with v3.5.0</h2> <h3>Added</h3> <ul> <li>Support for <code>schemars</code> integration added by <a href="https://github.com/swlynch99"><code>@swlynch99</code></a> (<a href="https://redirect.github.com/jonasbb/serde_with/issues/666">#666</a>) The support uses a new <code>Schema</code> top-level item which implements <code>JsonSchema</code> The <code>serde_as</code> macro can now detect <code>schemars</code> usage and emits matching annotations for all fields with <code>serde_as</code> attribute. Many types of this crate come already with support for the <code>schemars</code>, but support is not complete and will be extended over time.</li> </ul> <h2>serde_with v3.4.0</h2> <ul> <li> <p>Lower minimum required serde version to 1.0.152 (<a href="https://redirect.github.com/jonasbb/serde_with/issues/653">#653</a>) Thanks to <a href="https://github.com/banool"><code>@banool</code></a> for submitting the PR.</p> <p>This allows people that have a problem with 1.0.153 to still use <code>serde_with</code>.</p> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
dependabot[bot]
|
596a5db1a0 |
Bump bson from 2.7.0 to 2.9.0 (#368)
Bumps [bson](https://github.com/mongodb/bson-rust) from 2.7.0 to 2.9.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/mongodb/bson-rust/releases">bson's releases</a>.</em></p> <blockquote> <h2>v2.9.0</h2> <p>The MongoDB Rust driver team is pleased to announce the v2.9.0 release of the <code>bson</code> crate.</p> <h2>Highlighted Changes</h2> <p>This release adds several externally contributed improvements!</p> <ul> <li>A new <code>RawIter</code> type that iterates over elements in a document without deserializing them,</li> <li>An improvement to the <code>doc</code> and <code>bson</code> macros (and their <code>raw</code> counterparts) that allows using types that implement <code>Into<Bson></code> or <code>Into<RawBson></code>,</li> <li>An impl of <code>From<&mut T></code> for <code>Bson</code> for types that implement <code>Into<Bson></code>,</li> <li>A smaller dependency tree thanks to updating the indexmap crate,</li> <li>And a fix for the <code>serde_with</code> 3.x support for the <code>Uuid</code> type.</li> </ul> <h2>Full Release Notes</h2> <h2>New Features</h2> <ul> <li>RUST-1815 provide lazy iterator implementation (thanks <a href="https://github.com/tychoish"><code>@tychoish</code></a>!)</li> <li>RUST-1716 Add BSON Binary Data subtype Sensitive (<a href="https://redirect.github.com/mongodb/bson-rust/issues/454">#454</a>)</li> </ul> <h2>Improvements</h2> <ul> <li>RUST-1822 Allow using the {,raw}{bson,doc} with types implementing Into<!-- raw HTML omitted --> (<a href="https://redirect.github.com/mongodb/bson-rust/issues/450">#450</a>) (thanks <a href="https://github.com/tyilo"><code>@tyilo</code></a>!)</li> <li>RUST-1825 Implement From<!-- raw HTML omitted --> for Bson (<a href="https://redirect.github.com/mongodb/bson-rust/issues/452">#452</a>) (thanks <a href="https://github.com/tyilo"><code>@tyilo</code></a>!)</li> <li>RUST-1814 minor: bump indexmap to 2.1.0 (<a href="https://redirect.github.com/mongodb/bson-rust/issues/448">#448</a>) (thanks <a href="https://github.com/froydnj"><code>@froydnj</code></a>!)</li> </ul> <h2>Bugfixes</h2> <ul> <li>RUST-1828 Fix feature name for serde_with Uuid implementation (<a href="https://redirect.github.com/mongodb/bson-rust/issues/453">#453</a>) (thanks <a href="https://github.com/jonasbb"><code>@jonasbb</code></a>!)</li> </ul> <h2>v2.8.1</h2> <p>The MongoDB Rust driver team is pleased to announce the v2.8.1 release of the <code>bson</code> crate.</p> <h2>Highlighted Changes</h2> <p>This release fixes compilation for the <code>wasm32-wasi</code> target, which broke in the 2.8.0 release.</p> <h2>Full Release Notes</h2> <h2>Bugfixes</h2> <ul> <li>Fix compilation on wasm32-wasi target <a href="https://redirect.github.com/mongodb/bson-rust/issues/445">#445</a> (thanks <a href="https://github.com/tyranron"><code>@tyranron</code></a>!)</li> </ul> <h2>v2.8.0</h2> <p>The MongoDB Rust driver team is pleased to announce the v2.8.0 release of the <code>bson</code> crate.</p> <h2>Highlighted Changes</h2> <p>This release adds optimizations to the <code>serde</code> integration that show up to 50% deserialization speed improvement in our benchmarks, as well as a variety of user-submitted fixes.</p> <h2>Full Release Notes</h2> <h2>Improvements</h2> <ul> <li>RUST-1132 Implement DeserializeSeed for owned and borrowed raw documents (<a href="https://redirect.github.com/mongodb/bson-rust/issues/433">#433</a>)</li> <li>RUST-1780 Bump MSRV to 1.61.0, upgrade ahash to 0.8.5 in <code>Cargo.lock.msrv</code> (<a href="https://redirect.github.com/mongodb/bson-rust/issues/436">#436</a>) (thanks <a href="https://github.com/stIncMale"><code>@stIncMale</code></a>!)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
Daniel Harvey
|
bdd5d06437 |
Move all crates into a folder (#355)
<!-- Thank you for submitting this PR! :) --> ## Description This moves all the crates into a `/crates` folder. Everything appears to just work, thanks Cargo! V3_GIT_ORIGIN_REV_ID: 8e3ef287b1a46cabdb4d919a50e813ab2cddf8b1 |