Skip to content

Commit

Permalink
Fix a issue in the joinJson function
Browse files Browse the repository at this point in the history
  • Loading branch information
burner committed Feb 6, 2023
1 parent 91732b4 commit 6687b90
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/graphql/helper.d
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,10 @@ Json joinJson(JoinJsonPrecedence jjp = JoinJsonPrecedence.none)(Json a, Json b)
ret[key] = joinJson(*ap, value);
} else {
static if(jjp == JoinJsonPrecedence.none) {
throw new Exception(format(
"Can not join '%s' and '%s' on key '%s'",
ap.type, value.type, key));
enforce(ap.type == value.type && *ap == value
, format("Can not join '%s' and '%s' on key '%s'"
, ap.type, value.type, key)
);
} else static if(jjp == JoinJsonPrecedence.a) {
} else {
ret[key] = value;
Expand Down

0 comments on commit 6687b90

Please sign in to comment.