Skip to content

Commit

Permalink
Error Propagation Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
burner committed Dec 15, 2023
1 parent fd83f4a commit 6bc3c43
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions source/graphql/graphql.d
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,14 @@ class GraphQLD(T, QContext = DefaultContext) {
this.executationTraceLog.logf("elemType %s", elemType);
Json ret = returnTemplate();
ret["data"] = Json.emptyArray();
if(Constants.errors in objectValue
&& !objectValue[Constants.errors].dataIsEmpty())
{
ret[Constants.errors] = Json.emptyArray();
foreach(err; objectValue[Constants.errors]) {
ret[Constants.errors] ~= err;
}
}

QueryArrayResolver[string]* arrayTypeResolverArray =
unPacked !is null
Expand All @@ -511,6 +519,7 @@ class GraphQLD(T, QContext = DefaultContext) {
Json[] results = iota(items.length)
.map!(it => returnTemplate())
.array;

string[] fieldsHandledByArrayResolver;
if(arrayTypeResolverArray !is null) {
FieldRange fr = fieldRange(ss, doc
Expand Down

0 comments on commit 6bc3c43

Please sign in to comment.