Skip to content

Commit

Permalink
Handle null value for viewId in nextArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
sandreae committed Mar 23, 2023
1 parent 76c1d44 commit 89ff11e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions aquadoggo/src/graphql/queries/next_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ fn validate_args(
// Convert and validate passed parameters.
let public_key = PublicKeyScalar::from_value(args.next().unwrap())?;
let document_view_id = match args.next() {
Some(value) => match value {
async_graphql::Value::Null => None,
async_graphql::Value::String(_) => Some(value),
_ => panic!("Unexpected value type received for viewId in nextArgs"),
},
None => None,
};
let document_view_id = match document_view_id {
Some(value) => {
let document_view_id = DocumentViewIdScalar::from_value(value)?;
debug!(
Expand Down

0 comments on commit 89ff11e

Please sign in to comment.