From fd83f4af1e39962b56a717cd738c297f35d733ab Mon Sep 17 00:00:00 2001 From: Robert burner Schadek Date: Mon, 30 Oct 2023 15:30:35 +0100 Subject: [PATCH 1/2] darser is actually not needed --- dub.json | 1 - 1 file changed, 1 deletion(-) diff --git a/dub.json b/dub.json index 8e6e38a..d97722a 100644 --- a/dub.json +++ b/dub.json @@ -6,7 +6,6 @@ "dependencies" : { "fixedsizearray": ">=1.3.0", "vibe-d": ">=0.9.0", - "darser": ">=1.0.1", "nullablestore": ">=2.1.0" }, "dflags": [ "-d"], From d8438867584699d633929287972422a85e8019c1 Mon Sep 17 00:00:00 2001 From: Robert burner Schadek Date: Fri, 15 Dec 2023 17:23:37 +0100 Subject: [PATCH 2/2] Error Propagation Fix --- source/graphql/graphql.d | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/graphql/graphql.d b/source/graphql/graphql.d index ec03bad..1efe990 100644 --- a/source/graphql/graphql.d +++ b/source/graphql/graphql.d @@ -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 @@ -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