@@ -26,9 +26,7 @@ const client = new Grid({
2626 apiKey: process .env [' GRID_API_TOKEN' ], // This is the default and can be omitted
2727});
2828
29- const response = await client .workbooks .query (' YOUR_WORKBOOK_ID' , {
30- read: [' A1' , ' Sheet2!B3' , ' =SUM(A1:A4)' ],
31- });
29+ const response = await client .workbooks .query (' YOUR_WORKBOOK_ID' , { read: [' A1:A4' ] });
3230
3331console .log (response .read );
3432```
@@ -45,7 +43,7 @@ const client = new Grid({
4543 apiKey: process .env [' GRID_API_TOKEN' ], // This is the default and can be omitted
4644});
4745
48- const params: Grid .WorkbookQueryParams = { read: [' A1' , ' Sheet2!B3 ' , ' =SUM(A1 :A4) ' ] };
46+ const params: Grid .WorkbookQueryParams = { read: [' A1:A4' ] };
4947const response: Grid .WorkbookQueryResponse = await client .workbooks .query (
5048 ' YOUR_WORKBOOK_ID' ,
5149 params ,
@@ -92,7 +90,7 @@ a subclass of `APIError` will be thrown:
9290<!-- prettier-ignore -->
9391``` ts
9492const response = await client .workbooks
95- .query (' YOUR_WORKBOOK_ID' , { read: [' A1' , ' Sheet2!B3 ' , ' =SUM(A1 :A4) ' ] })
93+ .query (' YOUR_WORKBOOK_ID' , { read: [' A1:A4' ] })
9694 .catch (async (err ) => {
9795 if (err instanceof Grid .APIError ) {
9896 console .log (err .status ); // 400
@@ -133,7 +131,7 @@ const client = new Grid({
133131});
134132
135133// Or, configure per-request:
136- await client .workbooks .query (' YOUR_WORKBOOK_ID' , { read: [' A1' , ' Sheet2!B3 ' , ' =SUM(A1 :A4) ' ] }, {
134+ await client .workbooks .query (' YOUR_WORKBOOK_ID' , { read: [' A1:A4' ] }, {
137135 maxRetries: 5 ,
138136});
139137```
@@ -150,7 +148,7 @@ const client = new Grid({
150148});
151149
152150// Override per-request:
153- await client .workbooks .query (' YOUR_WORKBOOK_ID' , { read: [' A1' , ' Sheet2!B3 ' , ' =SUM(A1 :A4) ' ] }, {
151+ await client .workbooks .query (' YOUR_WORKBOOK_ID' , { read: [' A1:A4' ] }, {
154152 timeout: 5 * 1000 ,
155153});
156154```
@@ -203,7 +201,7 @@ const client = new Grid();
203201
204202const response = await client .workbooks .query (
205203 ' YOUR_WORKBOOK_ID' ,
206- { read: [' A1' , ' Sheet2!B3 ' , ' =SUM(A1 :A4) ' ] },
204+ { read: [' A1:A4' ] },
207205 { headers: { ' X-Client-Name' : ' My-Custom-Value' } },
208206);
209207```
@@ -222,14 +220,12 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
222220``` ts
223221const client = new Grid ();
224222
225- const response = await client .workbooks
226- .query (' YOUR_WORKBOOK_ID' , { read: [' A1' , ' Sheet2!B3' , ' =SUM(A1:A4)' ] })
227- .asResponse ();
223+ const response = await client .workbooks .query (' YOUR_WORKBOOK_ID' , { read: [' A1:A4' ] }).asResponse ();
228224console .log (response .headers .get (' X-My-Header' ));
229225console .log (response .statusText ); // access the underlying Response object
230226
231227const { data : response, response : raw } = await client .workbooks
232- .query (' YOUR_WORKBOOK_ID' , { read: [' A1' , ' Sheet2!B3 ' , ' =SUM(A1 :A4) ' ] })
228+ .query (' YOUR_WORKBOOK_ID' , { read: [' A1:A4' ] })
233229 .withResponse ();
234230console .log (raw .headers .get (' X-My-Header' ));
235231console .log (response .read );
0 commit comments