Fix operation_name not being set in juniper_hyper (#1169, #1187)

This commit is contained in:
Kai Ren 2023-09-12 14:45:56 +02:00 committed by GitHub
parent dadd318b85
commit f172be5656
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -14,7 +14,13 @@ All user visible changes to `juniper_actix` crate will be documented in this fil
- Switched to 0.16 version of [`juniper` crate]. - Switched to 0.16 version of [`juniper` crate].
- Switched to 0.4 version of [`juniper_graphql_ws` crate]. - Switched to 0.4 version of [`juniper_graphql_ws` crate].
### Fixed
- `operationName` not being set. ([#1187], [#1169])
[#1034]: /../../pull/1034 [#1034]: /../../pull/1034
[#1169]: /../../issues/1169
[#1187]: /../../pull/1187

View file

@ -212,7 +212,7 @@ where
S: ScalarValue, S: ScalarValue,
{ {
let mut query = None; let mut query = None;
let operation_name = None; let mut operation_name = None;
let mut variables = None; let mut variables = None;
for (key, value) in form_urlencoded::parse(input.as_bytes()).into_owned() { for (key, value) in form_urlencoded::parse(input.as_bytes()).into_owned() {
match key.as_ref() { match key.as_ref() {
@ -226,6 +226,7 @@ where
if operation_name.is_some() { if operation_name.is_some() {
return Err(invalid_err("operationName")); return Err(invalid_err("operationName"));
} }
operation_name = Some(value)
} }
"variables" => { "variables" => {
if variables.is_some() { if variables.is_some() {