You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Queries.md
+4-9Lines changed: 4 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -10,24 +10,19 @@ title: Queries
10
10
11
11
### getBy
12
12
13
-
`getBy*` queries returns the first matching node for a query, and throws an
14
-
error if no elements match.
13
+
`getBy*` queries return the first matching node for a query, and throw an error if no elements match or if more than one match is found (use `getAllBy` instead).
15
14
16
15
### getAllBy
17
16
18
-
`getAllBy*` queries return an array of all matching nodes for a query, and
19
-
throws an error if no elements match.
17
+
`getAllBy*` queries return an array of all matching nodes for a query, and throw an error if no elements match.
20
18
21
19
### queryBy
22
20
23
-
`queryBy*` queries returns the first matching node for a query, and return
24
-
`null` if no elements match. This is useful for asserting an element is not
25
-
present.
21
+
`queryBy*` queries return the first matching node for a query, and return `null` if no elements match. This is useful for asserting an element that is not present. This throws if more than one match is found (use `queryAllBy` instead).
26
22
27
23
### queryAllBy
28
24
29
-
`queryAllBy*` queries return an array of all matching nodes for a query, and
30
-
return an empty array (`[]`) if no elements match.
25
+
`queryAllBy*` queries return an array of all matching nodes for a query, and return an empty array (`[]`) if no elements match.
0 commit comments