Skip to content

Commit bc68a53

Browse files
Don't replace empty response with null. That empty response may be place holder for other async resource (Reference,Connection)
1 parent 7c3d20a commit bc68a53

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

schema/query/projection_evaluator.go

-4
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,6 @@ func evalProjection(ctx context.Context, p Projection, payload map[string]interf
214214
return fmt.Errorf("%s: error resolving field handler on sub-field: %v", name, err)
215215
}
216216
}
217-
// Return `null` for missing result instead of empty object
218-
if m, ok := v.(map[string]interface{}); ok && len(m) == 0 {
219-
v = nil
220-
}
221217
resMu.Lock()
222218
res[name] = v
223219
resMu.Unlock()

schema/query/projection_evaluator_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func TestProjectionEval(t *testing.T) {
236236
`reference{name}`,
237237
`{"reference":"100"}`,
238238
nil,
239-
`{"reference":null}`,
239+
`{"reference":{}}`,
240240
},
241241
{
242242
"Connection#1",

0 commit comments

Comments
 (0)