Skip to content

Commit 46f4060

Browse files
committed
Remove operation name from being reported
It's not reported by urql this way so we're trying to fetch something from a field that doesn't exist. It's stored on `operation.query.definitions[#].name.value`, where `definitions` is an array. If multiple definitions can exist with their own operation names, let's not try to store them all, because our tag value filter doesn't support substring matches and if more than one operation name is supported it makes it impossible to filter by it.
1 parent c0fc547 commit 46f4060

2 files changed

Lines changed: 0 additions & 20 deletions

File tree

packages/urql/src/__tests__/index.test.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ describe("reportGraphQLError", () => {
1010
},
1111
operation: {
1212
query: { loc: { source: { body: "query { post { id } }" } } },
13-
operationName: "GetPost",
1413
kind: "query"
1514
}
1615
}
@@ -27,7 +26,6 @@ describe("reportGraphQLError", () => {
2726
expect(span.setTags).toHaveBeenCalledWith({
2827
endpoint: "https://example.com/graphql"
2928
})
30-
expect(span.setTags).toHaveBeenCalledWith({ operationName: "GetPost" })
3129
expect(span.setTags).toHaveBeenCalledWith({ operationType: "query" })
3230
expect(span.setParams).toHaveBeenCalledWith({
3331
query: "query { post { id } }"
@@ -67,20 +65,6 @@ describe("reportGraphQLError", () => {
6765
})
6866
})
6967

70-
it("sets operationName tag on the span", () => {
71-
const { appsignal, span } = createMockAppsignal()
72-
const result = {
73-
error: { message: "Something went wrong" },
74-
operation: { operationName: "CreatePost" }
75-
}
76-
77-
reportGraphQLError(result, appsignal, {})
78-
79-
expect(span.setTags).toHaveBeenCalledWith({
80-
operationName: "CreatePost"
81-
})
82-
})
83-
8468
it("sets operationType tag on the span", () => {
8569
const { appsignal, span } = createMockAppsignal()
8670
const result = {

packages/urql/src/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ export function reportGraphQLError(
6969
}
7070
}
7171

72-
if (operation?.operationName) {
73-
span.setTags({ operationName: operation.operationName })
74-
}
75-
7672
if (operation?.kind) {
7773
span.setTags({ operationType: operation.kind })
7874
}

0 commit comments

Comments
 (0)