Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.

Commit 6f10763

Browse files
Divyendu Singhtimsuchanek
authored andcommitted
fix(client): handle null from server (#3922)
* fix(client): regression because non-scalar resolution, handle null from db better * test(client): snapshot conflict resolution * fix(client): reorder condition
1 parent d28cc75 commit 6f10763

4 files changed

Lines changed: 402 additions & 31 deletions

File tree

cli/packages/prisma-client-lib/src/Client.test.js.md

Lines changed: 94 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,73 @@ The actual snapshot is saved in `Client.test.js.snap`.
44

55
Generated by [AVA](https://ava.li).
66

7+
## automatic non-scalar sub selection
8+
9+
> Snapshot 1
10+
11+
`query ($where: UserWhereInput) {␊
12+
users(where: $where) {␊
13+
__typename␊
14+
}␊
15+
}␊
16+
`
17+
18+
## automatic non-scalar sub selection for a connection with scalars
19+
20+
> Snapshot 1
21+
22+
`query ($where: HouseWhereInput) {␊
23+
housesConnection(where: $where) {␊
24+
pageInfo {␊
25+
hasNextPage␊
26+
hasPreviousPage␊
27+
startCursor␊
28+
endCursor␊
29+
}␊
30+
edges {␊
31+
node {␊
32+
id␊
33+
name␊
34+
}␊
35+
cursor␊
36+
}␊
37+
}␊
38+
}␊
39+
`
40+
41+
## automatic non-scalar sub selection for a connection without scalars
42+
43+
> Snapshot 1
44+
45+
`query ($where: UserWhereInput) {␊
46+
usersConnection(where: $where) {␊
47+
pageInfo {␊
48+
hasNextPage␊
49+
hasPreviousPage␊
50+
startCursor␊
51+
endCursor␊
52+
}␊
53+
edges {␊
54+
node␊
55+
cursor␊
56+
}␊
57+
}␊
58+
}␊
59+
`
60+
61+
## automatic non-scalar sub selection for relation
62+
63+
> Snapshot 1
64+
65+
`query ($where: HouseWhereInput) {␊
66+
house(where: $where) {␊
67+
user {␊
68+
__typename␊
69+
}␊
70+
}␊
71+
}␊
72+
`
73+
774
## deep related type
875

976
> Snapshot 1
@@ -31,6 +98,19 @@ Generated by [AVA](https://ava.li).
3198
}␊
3299
`
33100

101+
## nested args
102+
103+
> Snapshot 1
104+
105+
`query ($where: PostInput!) {␊
106+
post(where: $where) {␊
107+
id␊
108+
title␊
109+
content␊
110+
}␊
111+
}␊
112+
`
113+
34114
## nested mbedded type
35115

36116
> Snapshot 1
@@ -57,9 +137,9 @@ Generated by [AVA](https://ava.li).
57137
id␊
58138
}␊
59139
}␊
60-
140+
`
61141

62-
## nested args
142+
## top level args
63143

64144
> Snapshot 1
65145
@@ -72,39 +152,26 @@ Generated by [AVA](https://ava.li).
72152
}␊
73153
`
74154

75-
## top level args
155+
## unpacking extract payload - array
76156

77157
> Snapshot 1
78158
79-
`query ($where: PostInput!) {␊
80-
post(where: $where) {␊
81-
id␊
82-
title␊
83-
content␊
84-
}␊
85-
}␊
86-
159+
'[{"id":"1","name":"Alice"},{"id":"2","name":"Bob"}]'
87160

88-
## automatic non-scalar sub selection
161+
## unpacking extract payload - nested array
89162

90163
> Snapshot 1
91164
92-
`query ($where: UserWhereInput) {␊
93-
users(where: $where) {␊
94-
__typename␊
95-
}␊
96-
}␊
97-
165+
'[{"id":"1","name":"My House"},{"id":"2","name":"Summer House"}]'
98166

99-
## automatic non-scalar sub selection for relation
167+
## unpacking extract payload - nested object
100168

101169
> Snapshot 1
102170
103-
`query ($where: HouseWhereInput) {␊
104-
house(where: $where) {␊
105-
user {␊
106-
__typename␊
107-
}␊
108-
}␊
109-
}␊
110-
`
171+
'{"id":"1","name":"My House"}'
172+
173+
## unpacking extract payload - null from server
174+
175+
> Snapshot 1
176+
177+
'null'
315 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)