@@ -22,7 +22,8 @@ type CliEnv struct {
2222 stdout io.Writer
2323 stderr io.Writer
2424 Path * PathStructure
25- domain string
25+ authURL string
26+ graphqlURL string
2627 branch string
2728 nhclient * nhostclient.Client
2829 nhpublicclient * nhostclient.Client
@@ -34,7 +35,8 @@ func New(
3435 stdout io.Writer ,
3536 stderr io.Writer ,
3637 path * PathStructure ,
37- domain string ,
38+ authURL string ,
39+ graphqlURL string ,
3840 branch string ,
3941 projectName string ,
4042 localSubdomain string ,
@@ -43,7 +45,8 @@ func New(
4345 stdout : stdout ,
4446 stderr : stderr ,
4547 Path : path ,
46- domain : domain ,
48+ authURL : authURL ,
49+ graphqlURL : graphqlURL ,
4750 branch : branch ,
4851 nhclient : nil ,
4952 nhpublicclient : nil ,
@@ -67,7 +70,8 @@ func FromCLI(cCtx *cli.Context) *CliEnv {
6770 cCtx .String (flagDataFolder ),
6871 cCtx .String (flagNhostFolder ),
6972 ),
70- domain : cCtx .String (flagDomain ),
73+ authURL : cCtx .String (flagAuthURL ),
74+ graphqlURL : cCtx .String (flagGraphqlURL ),
7175 branch : cCtx .String (flagBranch ),
7276 projectName : sanitizeName (cCtx .String (flagProjectName )),
7377 nhclient : nil ,
@@ -84,8 +88,12 @@ func (ce *CliEnv) LocalSubdomain() string {
8488 return ce .localSubdomain
8589}
8690
87- func (ce * CliEnv ) Domain () string {
88- return ce .domain
91+ func (ce * CliEnv ) AuthURL () string {
92+ return ce .authURL
93+ }
94+
95+ func (ce * CliEnv ) GraphqlURL () string {
96+ return ce .graphqlURL
8997}
9098
9199func (ce * CliEnv ) Branch () string {
@@ -99,7 +107,8 @@ func (ce *CliEnv) GetNhostClient(ctx context.Context) (*nhostclient.Client, erro
99107 return nil , fmt .Errorf ("failed to load session: %w" , err )
100108 }
101109 ce .nhclient = nhostclient .New (
102- ce .domain ,
110+ ce .authURL ,
111+ ce .graphqlURL ,
103112 graphql .WithAccessToken (session .Session .AccessToken ),
104113 )
105114 }
@@ -108,7 +117,7 @@ func (ce *CliEnv) GetNhostClient(ctx context.Context) (*nhostclient.Client, erro
108117
109118func (ce * CliEnv ) GetNhostPublicClient () (* nhostclient.Client , error ) {
110119 if ce .nhpublicclient == nil {
111- ce .nhpublicclient = nhostclient .New (ce .domain )
120+ ce .nhpublicclient = nhostclient .New (ce .authURL , ce . graphqlURL )
112121 }
113122 return ce .nhpublicclient , nil
114123}
0 commit comments