Skip to content

Commit 0b624ea

Browse files
authored
contrib/internal/graphql: rename location -> locations (#3361)
1 parent 2a6b3a9 commit 0b624ea

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

contrib/graphql-go/graphql/graphql_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ func TestErrorsAsSpanEvents(t *testing.T) {
250250
assert.Equal(t, map[string]any{
251251
"message": "test error",
252252
"path": []string{"withError"},
253-
"location": []string{"1:3"},
253+
"locations": []string{"1:3"},
254254
"stacktrace": evt.Config.Attributes["stacktrace"],
255255
"type": "gqlerrors.FormattedError",
256256
"extensions.str": "1",

contrib/internal/graphql/graphql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func errToSpanEventAttributes(gErr Error, errExtensions []string) map[string]any
8181
"stacktrace": takeStacktrace(0, 0),
8282
}
8383
if locs := parseErrLocations(gErr.Locations); len(locs) > 0 {
84-
res["location"] = locs
84+
res["locations"] = locs
8585
}
8686
if errPath := parseErrPath(gErr.Path); len(errPath) > 0 {
8787
res["path"] = errPath

contrib/internal/graphql/graphql_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func TestAddErrorsAsSpanEvents(t *testing.T) {
7373
wantAttrs1 := map[string]any{
7474
"message": "message 1",
7575
"type": "*errors.errorString",
76-
"location": []string{"1:2", "100:200"},
76+
"locations": []string{"1:2", "100:200"},
7777
"stacktrace": events[0].Config.Attributes["stacktrace"],
7878
"path": []string{"1", "2", "3", "4", "5", "6"},
7979
"extensions.ext1": "ext1",
@@ -88,7 +88,7 @@ func TestAddErrorsAsSpanEvents(t *testing.T) {
8888
wantAttrs2 := map[string]any{
8989
"message": "message 2",
9090
"type": "*errors.errorString",
91-
"location": []string{"2:3", "200:300"},
91+
"locations": []string{"2:3", "200:300"},
9292
"stacktrace": events[1].Config.Attributes["stacktrace"],
9393
"path": []string{"1", "2", "3", "4", "5", "6"},
9494
"extensions.ext1": "ext1",

0 commit comments

Comments
 (0)