Skip to content

Commit 5c809e6

Browse files
Merge pull request #332 from FormidableLabs/remove-deleted-attr-operationName
Replace 'operationName' attr with 'kind'
2 parents 0be55c5 + e3b22cc commit 5c809e6

File tree

12 files changed

+68
-65
lines changed

12 files changed

+68
-65
lines changed
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
4+
title: ""
55
labels: Bug
6-
assignees: ''
7-
6+
assignees: ""
87
---
98

109
# About
@@ -17,36 +16,38 @@ Devtools is unresponsive when using on an Android device with expo.
1716

1817
<!-- Replace the below steps with your reproduction. -->
1918

20-
1. Clone [this example](https://github.com/kadikraman/UrqlTest) react native project
21-
2. Plug in Android phone via USB
22-
3. Run `yarn install`
23-
4. Run `yarn start`
24-
5. Open devtools using npx `npx urql-devtools`
19+
1. Clone [this example](https://github.com/kadikraman/UrqlTest) react native project
20+
2. Plug in Android phone via USB
21+
3. Run `yarn install`
22+
4. Run `yarn start`
23+
5. Open devtools using npx `npx urql-devtools`
2524

2625
## Expected result
2726

2827
<!-- Tell us what you expected. -->
2928

30-
- App opens on Android phone
31-
- Urql Devtools opens in standalone window
32-
- Urql devtools detects app
29+
- App opens on Android phone
30+
- Urql Devtools opens in standalone window
31+
- Urql devtools detects app
3332

3433
## Actual result
3534

3635
<!-- Tell us what actually happened. -->
3736

38-
- App opens on Android phone
39-
- Urql devtools opens in standalone window
40-
- Urql devtools stays on "waiting for exchange" notice
37+
- App opens on Android phone
38+
- Urql devtools opens in standalone window
39+
- Urql devtools stays on "waiting for exchange" notice
4140

4241
# Additional info
4342

4443
<!-- For native bug reports -->
44+
4545
os: `Ubuntu 20.04`
4646
urql-devtools version: `v0.0.0`
4747
@urql/devtools version: `v0.0.0`
4848

4949
<!-- For browser extension bug reports -->
50+
5051
browser: `chrome 88 (macOS)`
5152
extension version: `v0.0.0`
5253
@urql/devtools version: `v0.0.0`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"@types/ws": "^7.2.6",
9595
"@typescript-eslint/eslint-plugin": "^4.3.0",
9696
"@typescript-eslint/parser": "^4.3.0",
97-
"@urql/core": "^1.12.3",
97+
"@urql/core": "^2.0.0",
9898
"@urql/devtools": "https://pkg.csb.dev/FormidableLabs/urql-devtools-exchange/commit/89b2a7aa/@urql/devtools",
9999
"awesome-typescript-loader": "^5.2.1",
100100
"babel-jest": "^26.3.0",

src/panel/context/Explorer/ast/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const expectCorrectOutput = (testcase: TestCase) => {
1717
const operation: Operation = {
1818
query: testcase.query,
1919
variables: testcase.variables,
20-
operationName: "query",
20+
kind: "query",
2121
context: { meta: { cacheOutcome: "hit" } },
2222
} as any;
2323

src/panel/context/Explorer/ast/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const handleResponse = ({
3737
data,
3838
parsedNodes = {},
3939
}: HandleResponseArgs): ParsedNodeMap => {
40-
if (operation.operationName !== "query") {
40+
if (operation.kind !== "query") {
4141
return parsedNodes;
4242
}
4343

src/panel/pages/events/Timeline.fixture.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Timeline } from "./Timeline";
66

77
const operation1 = {
88
key: 1,
9-
operationName: "query",
9+
kind: "query",
1010
query: gql`
1111
query Users {
1212
users {
@@ -23,7 +23,7 @@ const operation1 = {
2323

2424
const operation2 = {
2525
key: 2,
26-
operationName: "mutation",
26+
kind: "mutation",
2727
query: gql`
2828
mutation AddUser($id: ID!) {
2929
addUser(id: $id) {

src/panel/pages/events/Timeline.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ export const Timeline: FC<ComponentProps<typeof Page>> = (props) => {
100100
const sources = useMemo<Operation[]>(
101101
() =>
102102
eventOrder.map((key) => {
103-
const source = events[key].find(
104-
(e) => e.operation.operationName !== "teardown"
105-
);
103+
const source = events[key].find((e) => e.operation.kind !== "teardown");
106104

107105
// Only events for given source is teardown
108106
// Unknown source type
@@ -145,7 +143,7 @@ export const Timeline: FC<ComponentProps<typeof Page>> = (props) => {
145143
key={key}
146144
events={events[key]}
147145
style={{
148-
display: filter.graphqlType.includes(sources[i].operationName)
146+
display: filter.graphqlType.includes(sources[i].kind)
149147
? undefined
150148
: "none",
151149
}}
@@ -166,12 +164,10 @@ export const Timeline: FC<ComponentProps<typeof Page>> = (props) => {
166164
<TimelineSourceIcon
167165
key={s.key}
168166
title="Source operation"
169-
kind={
170-
s.operationName === "teardown" ? "query" : s.operationName
171-
}
167+
kind={s.kind === "teardown" ? "query" : s.kind}
172168
onClick={handleSourceClick(s)}
173169
style={{
174-
display: filter.graphqlType.includes(s.operationName)
170+
display: filter.graphqlType.includes(s.kind)
175171
? undefined
176172
: "none",
177173
}}

src/panel/pages/events/components/TimelinePane/TimelinePane.fixture.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const mockDebugEvent: DebugEvent = {
1414
message: "An operation was executed",
1515
source: "MyComponent",
1616
operation: {
17-
operationName: "query",
17+
kind: "query",
1818
key: 1,
1919
context: {
2020
requestPolicy: "network-only",

src/panel/pages/events/components/TimelinePane/TimelinePane.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const SourceSection: FC<{ operation: Operation }> = ({ operation }) => (
9090
<Heading>Key</Heading>
9191
<p>{operation.key}</p>
9292
<Heading>Operation type</Heading>
93-
<p>{operation.operationName}</p>
93+
<p>{operation.kind}</p>
9494
<br />
9595
<Heading>Query</Heading>
9696
<CodeHighlight

0 commit comments

Comments
 (0)