JakeLoew
WWasp
•Created by JakeLoew on 1/8/2025 in #🙋questions
Accessing relation fields on logged in user
Say I have a
User
model that is defined with relation fields. For example a user can belong to many organizations. Is there a way to populate context.user
with the related properties? Or do I need to query User
with include
every time I want to read the relation?
I was looking at the docs for accessing the logged in user and didn't find an answer to this specifically.
Wasp version ^0.15.06 replies
WWasp
•Created by JakeLoew on 1/8/2025 in #🙋questions
Roll back migration without destroying data
I have added a new model to my
schema.prisma
and run a single migration. I'd like to roll back my db to the previous migration, but it seems I am unable to do so without resetting the schema and dropping all my data, even though the table is not populated with any data. How can I migrate backward non-destructively?
Wasp version ^0.15.0.6 replies
WWasp
•Created by JakeLoew on 12/18/2024 in #🙋questions
Use case for functions exposed by wasp/server/operations
When you define an operation in
main.wasp
, the framework compiles and creates 2 exports of the same name. One from wasp/client/operations
and one from wasp/server/operations
. Of couse you would invoke the operation from wasp/client/operations
to on the frontend. I'm wondering: what is the use case for the function exported from wasp/server/operations
?9 replies
WWasp
•Created by JakeLoew on 12/4/2024 in #🙋questions
Skip email verification for users invited via email.
In my app, users can invite someone to join their organization via email. I’d like to make it so that invited users don’t have to verify their email address once they sign up, as they have already clicked a link in their email.
After doing some research, and reading questions posted in this discord, it seems like this is not supported by wasp.
It seems possible if I could generate an AuthIdentity and verification token at the time the invitation is sent, then add the token as part of the link sent in the invitation email and verify it when the user lands on the page I link them to. I’m just not sure how to make the ends meet. Any insights?
Using the SaaS template.
Wasp version 0.15.1
13 replies
WWasp
•Created by JakeLoew on 11/5/2024 in #🙋questions
Is there a way to inject env variables into wasp testing?
I have code that throws an error if a value from
.env.server
is not present. This code runs on the server.
I can do something like MY_SECRET=abc123 wasp client test run
, but I'm wondering if there's a way to do it within the wasp api.15 replies
WWasp
•Created by JakeLoew on 9/30/2024 in #🙋questions
Client Side Routing
I'm using a custom deployment strategy for the server and client following this approach from the wasp documentation. I have various routes defined--
/
, /my-dashboard
...etc. The pages render fine when you go to /
and navigate to them via links on the page. However you get 404'd when trying to load https://my-site.com/my-dashboard
, since they are SPA routes and there is no my-dashboard.html
--i.e. they are not genuine html routes. I'm not sure how to specify that the site is a SPA using client routing.9 replies
WWasp
•Created by JakeLoew on 9/18/2024 in #🙋questions
How to update data coming from `useQuery`
Let's say you have the following code in an app that has a
model Author
as well as model Book
where each book belongs to one author...
What is a good pattern to update data coming from the getAuthor
query when a new book is created?12 replies
WWasp
•Created by JakeLoew on 8/8/2024 in #🙋questions
find-or-create with social login -- SaaS template
Using the SaaS template, is there a way to get a sort of find-or-create behavior from social login? Take this case, for example: I go to /signup and signup with GitHub. I have an email [email protected]. If I try to go to /login and log in with google, the existing user should be found and logged in, no? What I’m seeing is that I get an error: “Save failed: user with the same identity already exists”.
Wasp v0.14.0
13 replies
WWasp
•Created by JakeLoew on 7/24/2024 in #🙋questions
useQuery error handling
I'm wondering why
useQuery
from wasp/client/operations
doesn't handle errors as I expect. Consider the following:
The response from /operations-get-application-by-id
is always 404, yet no error is returned from useQuery
and isError
is always false
. status
is "loading"
39 replies
WWasp
•Created by JakeLoew on 7/19/2024 in #🙋questions
migrate-dev failure when adding property to entity
Trying to perform a migration where I add an optional field to User, but since there already exist users in the DB the migration fails. For example:
Migrating from:
To:
run
wasp db migrate-dev
Fails with
Wasp version: 0.13.2 (entities defined in main.wasp
)30 replies