Currently, commands call get_active_session_client(). This method then pulls in any configuration information from CommandContext (which is packaged along with the commands, rightfully).
Instead, we should invert this dependency by adding a class method to CommandContext, e.g., CommandContext.get_client(). This method will instead call get_active_session_client() to get the persistent session before injecting any ad-hoc modifications, like a Hasura admin secret.
This returns the get_active_session_client() util to actually only referencing the active session
CommandContext.get_client() would then be an easy place to, e.g., pick up a command-line option to load a different configuration than the active one.
Proposal:
get_active_session_client()
. This method then pulls in any configuration information fromCommandContext
(which is packaged along with the commands, rightfully).CommandContext
, e.g.,CommandContext.get_client()
. This method will instead callget_active_session_client()
to get the persistent session before injecting any ad-hoc modifications, like a Hasura admin secret.get_active_session_client()
util to actually only referencing the active sessionCommandContext.get_client()
would then be an easy place to, e.g., pick up a command-line option to load a different configuration than the active one.