const result = await db.query.tableGame.findFirst({
with: {
gameCategories: true,
},
});
console.log();
// The current result type is
const result: {
userId: string | null;
createdAt: number;
updatedAt: number;
deletedAt: number | null;
gameId: string;
title: string;
publisher: string;
numberOfPlayers: number;
playtime: number;
coverImageUrl: string | null;
gameCategories: {
createdAt: number;
updatedAt: number;
deletedAt: number | null;
gameId: string | null;
categoryId: string | null;
gameCategoryId: string;
}[];
} | undefined
// is there an easy way to make it do this
const result: {
game: {
userId: string | null;
createdAt: number;
updatedAt: number;
deletedAt: number | null;
gameId: string;
title: string;
publisher: string;
numberOfPlayers: number;
playtime: number;
coverImageUrl: string | null;
}
gameCategories: {
createdAt: number;
updatedAt: number;
deletedAt: number | null;
gameId: string | null;
categoryId: string | null;
gameCategoryId: string;
}[];
} | undefined
const result = await db.query.tableGame.findFirst({
with: {
gameCategories: true,
},
});
console.log();
// The current result type is
const result: {
userId: string | null;
createdAt: number;
updatedAt: number;
deletedAt: number | null;
gameId: string;
title: string;
publisher: string;
numberOfPlayers: number;
playtime: number;
coverImageUrl: string | null;
gameCategories: {
createdAt: number;
updatedAt: number;
deletedAt: number | null;
gameId: string | null;
categoryId: string | null;
gameCategoryId: string;
}[];
} | undefined
// is there an easy way to make it do this
const result: {
game: {
userId: string | null;
createdAt: number;
updatedAt: number;
deletedAt: number | null;
gameId: string;
title: string;
publisher: string;
numberOfPlayers: number;
playtime: number;
coverImageUrl: string | null;
}
gameCategories: {
createdAt: number;
updatedAt: number;
deletedAt: number | null;
gameId: string | null;
categoryId: string | null;
gameCategoryId: string;
}[];
} | undefined