File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
graphql-playground-electron/src/renderer/components
graphql-playground-react/src/components Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -327,7 +327,9 @@ cd ${folderPath}; graphql playground`)
327327
328328 console . log ( 'setting' , { state } )
329329
330- this . serializeWorkspace ( state )
330+ if ( endpoint ) {
331+ this . serializeWorkspace ( state )
332+ }
331333
332334 this . setState ( state )
333335 }
Original file line number Diff line number Diff line change @@ -180,6 +180,23 @@ class PlaygroundWrapper extends React.Component<
180180 ) {
181181 const configIsYaml = this . isConfigYaml ( nextProps . configString )
182182 this . setState ( { configIsYaml } )
183+ if ( nextProps . config ) {
184+ const activeEnv = this . getInitialActiveEnv ( nextProps . config )
185+ const endpoints = getActiveEndpoints (
186+ nextProps . config ,
187+ activeEnv . activeEnv ! ,
188+ this . state . activeProjectName ,
189+ )
190+ const endpoint = endpoints . endpoint
191+ const subscriptionEndpoint = endpoints . subscriptionEndpoint
192+ const headers = endpoints . headers
193+ this . setState ( {
194+ endpoint,
195+ subscriptionEndpoint,
196+ headers,
197+ activeEnv : activeEnv . activeEnv ,
198+ } )
199+ }
183200 }
184201 }
185202
You can’t perform that action at this time.
0 commit comments