Skip to content

Commit

Permalink
Merge pull request #6 from hasura/fix-mutations
Browse files Browse the repository at this point in the history
Fix mutations
  • Loading branch information
BenoitRanque authored Jul 29, 2024
2 parents e75927f + 9386f50 commit 1cfb5d3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.2]

- Fix issue where we looked for mutation fields in the query type, making all mutations fail

## [0.1.1]

- Forward errors from underlying source to users using 422 status code
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
members = ["crates/ndc-graphql", "crates/ndc-graphql-cli", "crates/common"]
resolver = "2"

package.version = "0.1.1"
package.version = "0.1.2"
package.edition = "2021"
10 changes: 6 additions & 4 deletions crates/ndc-graphql/src/query_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ pub fn build_mutation_document(
} => {
let alias = format!("procedure_{index}");
let field_definition =
configuration.schema.query_fields.get(name).ok_or_else(|| {
QueryBuilderError::QueryFieldNotFound {
configuration
.schema
.mutation_fields
.get(name)
.ok_or_else(|| QueryBuilderError::MutationFieldNotFound {
field: name.to_owned(),
}
})?;
})?;

let (headers, procedure_arguments) =
extract_headers(arguments, map_arg, configuration)?;
Expand Down

0 comments on commit 1cfb5d3

Please sign in to comment.