@@ -93,7 +93,7 @@ Here's a single expression to a query builder, which can be expected to return
93
93
a single result:
94
94
95
95
``` typescript
96
- const earth = source .query ((q ) =>
96
+ const earth = await source .query ((q ) =>
97
97
q .findRecord ({ type: ' planet' , id: ' earth' })
98
98
);
99
99
```
@@ -102,15 +102,15 @@ That same expression could be passed in an array, which will cause results to be
102
102
returned in an array:
103
103
104
104
``` typescript
105
- const [earth] = source .query ((q ) => [
105
+ const [earth] = await source .query ((q ) => [
106
106
q .findRecord ({ type: ' planet' , id: ' earth' })
107
107
]);
108
108
```
109
109
110
110
And of course, that array could be expanded to include more than one expression:
111
111
112
112
``` typescript
113
- const [earth, jupiter, saturn] = source .query ((q ) => [
113
+ const [earth, jupiter, saturn] = await source .query ((q ) => [
114
114
q .findRecord ({ type: ' planet' , id: ' earth' }),
115
115
q .findRecord ({ type: ' planet' , id: ' jupiter' }),
116
116
q .findRecord ({ type: ' planet' , id: ' saturn' })
@@ -134,7 +134,7 @@ All the patterns mentioned above for queries also apply to transforms.
134
134
A single operation provided to a transform builder will return a single result:
135
135
136
136
``` typescript
137
- const earth = source .update ((t ) =>
137
+ const earth = await source .update ((t ) =>
138
138
t .addRecord ({ type: ' planet' , id: ' earth' })
139
139
);
140
140
```
@@ -143,15 +143,15 @@ The same expression passed in an array will cause results to be returned in an
143
143
array:
144
144
145
145
``` typescript
146
- const [earth] = source .update ((t ) => [
146
+ const [earth] = await source .update ((t ) => [
147
147
t .addRecord ({ type: ' planet' , id: ' earth' })
148
148
]);
149
149
```
150
150
151
151
And as before, multi-operation transforms will produce an array of results:
152
152
153
153
``` typescript
154
- const [earth, jupiter, saturn] = source .update ((t ) => [
154
+ const [earth, jupiter, saturn] = await source .update ((t ) => [
155
155
t .addRecord ({ type: ' planet' , id: ' earth' }),
156
156
t .addRecord ({ type: ' planet' , id: ' jupiter' }),
157
157
t .addRecord ({ type: ' planet' , id: ' saturn' })
0 commit comments