mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-24 09:34:28 +03:00
16 lines
381 B
JavaScript
16 lines
381 B
JavaScript
|
export const getThoughts = async (args, context) => {
|
||
|
return context.entities.Thought.findMany({
|
||
|
orderBy: [{ createdAt: 'desc' }],
|
||
|
include: { tags: true },
|
||
|
where: {
|
||
|
tags: { some: { name: args.tagName || undefined } }
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export const getTags = async (args, context) => {
|
||
|
return context.entities.Tag.findMany({
|
||
|
orderBy: [{ name: 'asc' }],
|
||
|
})
|
||
|
}
|