diff --git a/CHANGELOG.md b/CHANGELOG.md index 7153c37..c19a28e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Cargo.lock b/Cargo.lock index 62e78aa..25da144 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -354,7 +354,7 @@ dependencies = [ [[package]] name = "common" -version = "0.1.1" +version = "0.1.2" dependencies = [ "glob-match", "graphql-parser", @@ -1124,7 +1124,7 @@ dependencies = [ [[package]] name = "ndc-graphql" -version = "0.1.1" +version = "0.1.2" dependencies = [ "async-trait", "common", @@ -1142,7 +1142,7 @@ dependencies = [ [[package]] name = "ndc-graphql-cli" -version = "0.1.1" +version = "0.1.2" dependencies = [ "clap", "common", diff --git a/Cargo.toml b/Cargo.toml index 8cf324a..63e8d9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/crates/ndc-graphql/src/query_builder.rs b/crates/ndc-graphql/src/query_builder.rs index 137d6a2..bebe211 100644 --- a/crates/ndc-graphql/src/query_builder.rs +++ b/crates/ndc-graphql/src/query_builder.rs @@ -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)?;