Yah thats what I was thinking. I'm not overly concerned about trying to optimize for the perf of it because its a one time event, but i do want to be able to code the invocation of the action in a way that reads like a trigger.
I was tracking with the need to use an action, but I couldn't figure out how to run that action in that auth callback, and had an equal amount of luck getting trying to kickoff a mutation in the callback and calling an action from there.
I guess, as I'm reading both of your responses I'm tracking that it isn't the right context to call actions from. I guess I was just hoping for some way to group the functionality together in a way that I would typically do from a backend function.
- listen for record inserts on the users table
- invoke special trigger action that...
- calls 3rd party to create customer and portal link
- patches user record with those fields (optional in the schema of course)
- the user query on the client updates (this is already happening beautifully of course)
- I redirect user to the link to pick a subscription
After the successful sign up, the app stays in a loading state waiting for the record to have those fields.
Ideal situation for me is that 2-3 are action, 4 is internal mutation called by that action, and i can associate that action with the createUser event in a way that's highly readable and associated closely with the file I'm using for the action and internal mutation.