Hello,
Following is part of my schema:
model BudgetCategoryGroup {
id String @id @default(uuid())
name String
sortOrder Int
budgetCategories BudgetCategory[]
monthlyCategoryGroupActivities MonthlyCategoryGroupActivity[]
}
model BudgetCategory {
id String @id @default(uuid())
name String
sortOrder Int
budgetCategoryGroup BudgetCategoryGroup @relation(fields: [budgetCategoryGroupId], references: [id])
budgetCategoryGroupId String
}
Here is my service to query a budgetCategory and a budgetCategoryGroup.
export const testBudget: QueryResolvers['testBudget'] = async () => {
const test = await db.budget.findMany({
include: {
budgetCategoryGroups: {
where: {
id: '6866c300-2af3-4a48-9f33-101e64e0d6cb',
},
},
},
where: {
id: '0209a1b0-4718-4275-a073-cb29a9f8b625',
},
})
console.log(test[0].budgetCategoryGroups[0])
return test
}
And when I try to query the result using GraphQL, the result that I got from the API is different with the result I got directly from Prisma (using the console.log in the service above).
Server’s Log:
api | {
api | id: '6866c300-2af3-4a48-9f33-101e64e0d6cb',
api | name: 'Kids',
api | sortOrder: 1221,
api | budgetId: '0209a1b0-4718-4275-a073-cb29a9f8b625'
api | }
I am wondering whether I did something wrong or it is just a bug.