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`)
327
327
328
328
console . log ( 'setting' , { state } )
329
329
330
- this . serializeWorkspace ( state )
330
+ if ( endpoint ) {
331
+ this . serializeWorkspace ( state )
332
+ }
331
333
332
334
this . setState ( state )
333
335
}
Original file line number Diff line number Diff line change @@ -180,6 +180,23 @@ class PlaygroundWrapper extends React.Component<
180
180
) {
181
181
const configIsYaml = this . isConfigYaml ( nextProps . configString )
182
182
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
+ }
183
200
}
184
201
}
185
202
You can’t perform that action at this time.
0 commit comments