Skip to content

Commit 1cfb5d3

Browse files
authored
Merge pull request #6 from hasura/fix-mutations
Fix mutations
2 parents e75927f + 9386f50 commit 1cfb5d3

4 files changed

Lines changed: 14 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.1.2]
11+
12+
- Fix issue where we looked for mutation fields in the query type, making all mutations fail
13+
1014
## [0.1.1]
1115

1216
- Forward errors from underlying source to users using 422 status code

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
members = ["crates/ndc-graphql", "crates/ndc-graphql-cli", "crates/common"]
33
resolver = "2"
44

5-
package.version = "0.1.1"
5+
package.version = "0.1.2"
66
package.edition = "2021"

crates/ndc-graphql/src/query_builder.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ pub fn build_mutation_document(
5252
} => {
5353
let alias = format!("procedure_{index}");
5454
let field_definition =
55-
configuration.schema.query_fields.get(name).ok_or_else(|| {
56-
QueryBuilderError::QueryFieldNotFound {
55+
configuration
56+
.schema
57+
.mutation_fields
58+
.get(name)
59+
.ok_or_else(|| QueryBuilderError::MutationFieldNotFound {
5760
field: name.to_owned(),
58-
}
59-
})?;
61+
})?;
6062

6163
let (headers, procedure_arguments) =
6264
extract_headers(arguments, map_arg, configuration)?;

0 commit comments

Comments
 (0)