Mutations run in an weird order
So basically I want to create a room using a question and name a user inputs, which would be the
input
and name
state variables. The room is created every time, which is what I want since I need the room id to add the user. The issue is that when the user submits the create a room form, the member is not created nor are they added to the room initially.
However, when the user resubmits the form with the same data, a new room is created and the new member is created in the database.
I want the member and room to be created on the first submit of the form, but can't seem to figure out why it isn't working. Any help would be appreciated.
Here is the snippet of code:
And here is my schema I'm using:
3 Replies
mutateAsync returns a promise, so make sure you await it
i tried that too
wait
yea i did that
wait
i think i might be dum
ok i fixed it ya
so i wasn't using the result from mutateasync
and ye i also need to await it
tanks
I'm glad it worked out!!