You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rewrite Gel currentUser global provider logic to use SessionHost
The former impl was nice because it was decoupled from Gel driver logic.
But it was a lot of logic to figure out this "current user" from the `ExecutionContext`,
and that would've felt really bad to couple to the DB layer.
Mainly the former impl doesn't work going forward, because it assumed the session would not change within the GQL operation.
This is one of the main features we're making room for.
So now that the session can change, we don't know when to read what the current user should be.
We need to take the current ALS value right when the query is being executed.
Now that we're slicing the layers differently, giving the session/"current user" its own holder (ALS), we don't have to "dig deep" into the `ExecutionContext` to pull out this value.
Coupling this `SessionHost` to the `Gel` service is less painful than it would've been previously and allows us to read the current ALS value right when needed.
Perhaps there is another way to decouple this later. Maybe with some query events/hooks?
0 commit comments