Skip to content

Commit 2528714

Browse files
committed
Fix for bad types in the example
1 parent adccecd commit 2528714

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

packages/trigger-sdk/src/v3/query.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ function execute<TRow extends Record<string, any> = Record<string, any>>(
133133
): Promise<{ format: "json"; results: Array<TRow> } | { format: "csv"; results: string }> {
134134
const apiClient = apiClientManager.clientOrThrow();
135135

136-
const format = options?.format ?? "json";
137-
138136
const $requestOptions = mergeRequestOptions(
139137
{
140138
tracer,

references/hello-world/src/trigger/query.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { logger, query, task } from "@trigger.dev/sdk";
22

33
// Type definition for a run row
44
type RunRow = {
5-
id: string;
5+
run_id: string;
66
status: string;
77
triggered_at: string;
88
total_duration: number;
@@ -37,7 +37,7 @@ export const simpleQueryTask = task({
3737
// Now we have full type safety on the rows!
3838
typedResult.results.forEach((row, index) => {
3939
logger.info(`Run ${index + 1}`, {
40-
id: row.id, // TypeScript knows this is a string
40+
run_id: row.run_id, // TypeScript knows this is a string
4141
status: row.status, // TypeScript knows this is a string
4242
total_duration: row.total_duration, // TypeScript knows this is a number
4343
});

0 commit comments

Comments
 (0)