Skip to content

Commit

Permalink
fix: Change updateNode.Source() to reture n.results and update the
Browse files Browse the repository at this point in the history
tests.
  • Loading branch information
shahzadlone committed Jun 10, 2022
1 parent e4ba64a commit 2e6f67d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion query/graphql/planner/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (n *updateNode) Close() error {
return n.results.Close()
}

func (n *updateNode) Source() planNode { return nil }
func (n *updateNode) Source() planNode { return n.results }

// Explain method returns a map containing all attributes of this node that
// are to be explained, subscribes / opts-in this node to be an explainablePlanNode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ func TestExplainSimpleMutationUpdateWithBooleanFilter(t *testing.T) {
},
},
"ids": []string(nil),
"selectTopNode": dataMap{
"renderNode": dataMap{
"selectNode": dataMap{
"filter": nil,
"scanNode": dataMap{
"collectionID": "1",
"collectionName": "user",
"filter": nil,
"spans": []dataMap{},
},
},
},
},
},
},
},
Expand Down Expand Up @@ -128,6 +141,19 @@ func TestExplainSimpleMutationUpdateWithIdInFilter(t *testing.T) {
"bae-0a24cf29-b2c2-5861-9d00-abd6250c475d",
"bae-958c9334-73cf-5695-bf06-cf06826babfa",
},
"selectTopNode": dataMap{
"renderNode": dataMap{
"selectNode": dataMap{
"filter": nil,
"scanNode": dataMap{
"collectionID": "1",
"collectionName": "user",
"filter": nil,
"spans": []dataMap{},
},
},
},
},
},
},
},
Expand Down Expand Up @@ -180,6 +206,19 @@ func TestExplainSimpleMutationUpdateWithIdEqualsFilter(t *testing.T) {
"ids": []string{
"bae-0a24cf29-b2c2-5861-9d00-abd6250c475d",
},
"selectTopNode": dataMap{
"renderNode": dataMap{
"selectNode": dataMap{
"filter": nil,
"scanNode": dataMap{
"collectionID": "1",
"collectionName": "user",
"filter": nil,
"spans": []dataMap{},
},
},
},
},
},
},
},
Expand Down

0 comments on commit 2e6f67d

Please sign in to comment.