Skip to content

Commit

Permalink
another bug bites the dusk
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Schadek authored and burner committed Jun 19, 2019
1 parent 250144b commit 0ab3ee1
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions source/graphql/graphql.d
Original file line number Diff line number Diff line change
Expand Up @@ -207,26 +207,21 @@ class GraphQLD(T, QContext = DefaultContext) {
Json ret = returnTemplate();
foreach(op; ops) {
Json tmp = this.executeOperation(op, variables, doc, context);
this.executationTraceLog.logf("%s\n%s", ret, tmp);
if(canFind([OperationDefinitionEnum.OT_N,
OperationDefinitionEnum.OT_N_D,
OperationDefinitionEnum.OT_N_V,
OperationDefinitionEnum.OT_N_VD], op.ruleSelection))
{
if(tmp.type == Json.Type.object && "data" in tmp) {
foreach(key, value; tmp["data"].byKeyValue()) {
if(key in ret["data"]) {
this.executationTraceLog.logf(
"key %s already present", key
);
continue;
}
ret["data"][key] = value;
this.executationTraceLog.logf("%s\n%s\n%s", op.ruleSelection, ret,
tmp);
if(tmp.type == Json.Type.object && "data" in tmp) {
foreach(key, value; tmp["data"].byKeyValue()) {
if(key in ret["data"]) {
this.executationTraceLog.logf(
"key %s already present", key
);
continue;
}
ret["data"][key] = value;
}
foreach(err; tmp["error"]) {
ret["error"] ~= err;
}
}
foreach(err; tmp["error"]) {
ret["error"] ~= err;
}
}
return ret;
Expand Down

0 comments on commit 0ab3ee1

Please sign in to comment.