0xtlt
0xtlt
WWasp-lang
Created by 0xtlt on 4/18/2023 in #đŸ™‹questions
Client Page component query parameter
No description
8 replies
WWasp-lang
Created by 0xtlt on 4/17/2023 in #đŸ™‹questions
Query Typescript
I have the following code in my main.wasp:
query getIdeas {
// We specify that JS implementation of the query (which is an async JS function)
// can be found in `src/server/queries.js` as the named export `getTasks`.
// Use '@server' to reference files inside the src/server folder.
fn: import { getIdeas } from "@server/queries.js",
// We tell Wasp that this query is doing something with entity `Task`. With that, Wasp will
// automatically refresh the results of this query when tasks change.
entities: [Idea]
}
query getIdeas {
// We specify that JS implementation of the query (which is an async JS function)
// can be found in `src/server/queries.js` as the named export `getTasks`.
// Use '@server' to reference files inside the src/server folder.
fn: import { getIdeas } from "@server/queries.js",
// We tell Wasp that this query is doing something with entity `Task`. With that, Wasp will
// automatically refresh the results of this query when tasks change.
entities: [Idea]
}
And query.ts:
export const getIdeas = async (args, context) => {
return context.entities.Idea.findMany({});
};
export const getIdeas = async (args, context) => {
return context.entities.Idea.findMany({});
};
Do Wasp have a type to have typescript types on the args and context ?
5 replies
WWasp-lang
Created by 0xtlt on 4/17/2023 in #đŸ™‹questions
Prisma Enum
Hi guys! Do you know how to define an enum prisma database type with Wasp ?
15 replies