Skip to content

Commit

Permalink
fix mutation input explain label
Browse files Browse the repository at this point in the history
  • Loading branch information
nasdf committed Jan 10, 2024
1 parent f0687c9 commit 245ceb5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion client/request/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const (
RelatedObjectID = "_id"

Cid = "cid"
Data = "data"
Input = "input"
FieldName = "field"
FieldIDName = "fieldId"
Expand Down
2 changes: 1 addition & 1 deletion planner/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (n *createNode) Explain(explainType request.ExplainType) (map[string]any, e
switch explainType {
case request.SimpleExplain:
return map[string]any{
dataLabel: n.input,
inputLabel: n.input,
}, nil

case request.ExecuteExplain:
Expand Down
2 changes: 1 addition & 1 deletion planner/explain.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const (
childFieldNameLabel = "childFieldName"
collectionIDLabel = "collectionID"
collectionNameLabel = "collectionName"
dataLabel = "data"
inputLabel = "input"
fieldNameLabel = "fieldName"
filterLabel = "filter"
joinRootLabel = "root"
Expand Down
2 changes: 1 addition & 1 deletion planner/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (n *updateNode) simpleExplain() (map[string]any, error) {
}

// Add the attribute that represents the patch to update with.
simpleExplainMap[dataLabel] = n.input
simpleExplainMap[inputLabel] = n.input

return simpleExplainMap, nil
}
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/explain/default/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestDefaultExplainMutationRequestWithCreate(t *testing.T) {
TargetNodeName: "createNode",
IncludeChildNodes: false,
ExpectedAttributes: dataMap{
"data": dataMap{
"input": dataMap{
"age": int32(27),
"name": "Shahzad Lone",
"verified": true,
Expand Down Expand Up @@ -90,7 +90,7 @@ func TestDefaultExplainMutationRequestDoesNotCreateDocGivenDuplicate(t *testing.
TargetNodeName: "createNode",
IncludeChildNodes: false,
ExpectedAttributes: dataMap{
"data": dataMap{
"input": dataMap{
"age": int32(27),
"name": "Shahzad Lone",
},
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/explain/default/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestDefaultExplainMutationRequestWithUpdateUsingBooleanFilter(t *testing.T)
TargetNodeName: "updateNode",
IncludeChildNodes: false,
ExpectedAttributes: dataMap{
"data": dataMap{
"input": dataMap{
"age": int32(59),
},
"filter": dataMap{
Expand Down Expand Up @@ -130,7 +130,7 @@ func TestDefaultExplainMutationRequestWithUpdateUsingIds(t *testing.T) {
TargetNodeName: "updateNode",
IncludeChildNodes: false,
ExpectedAttributes: dataMap{
"data": dataMap{
"input": dataMap{
"age": int32(59),
},
"filter": nil,
Expand Down Expand Up @@ -195,7 +195,7 @@ func TestDefaultExplainMutationRequestWithUpdateUsingId(t *testing.T) {
TargetNodeName: "updateNode",
IncludeChildNodes: false,
ExpectedAttributes: dataMap{
"data": dataMap{
"input": dataMap{
"age": int32(59),
},
"filter": nil,
Expand Down Expand Up @@ -263,7 +263,7 @@ func TestDefaultExplainMutationRequestWithUpdateUsingIdsAndFilter(t *testing.T)
TargetNodeName: "updateNode",
IncludeChildNodes: false,
ExpectedAttributes: dataMap{
"data": dataMap{
"input": dataMap{
"age": int32(59),
},
"filter": dataMap{
Expand Down

0 comments on commit 245ceb5

Please sign in to comment.