Skip to content

Commit 9886f15

Browse files
committed
Fix env var injection
1 parent 0ebd6d5 commit 9886f15

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/graphql-playground/src/components/MiddlewareApp.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ class MiddlewareApp extends React.Component<Props, State> {
165165
) {
166166
const { config, configIsYaml } = this.parseGraphQLConfig(
167167
nextProps.configString,
168+
nextProps.env,
168169
)
169170
this.setState({ config, configIsYaml })
170171
}
@@ -196,6 +197,7 @@ class MiddlewareApp extends React.Component<Props, State> {
196197

197198
parseGraphQLConfig(
198199
configString: string,
200+
env = this.props.env,
199201
): { config: GraphQLConfig; configIsYaml: boolean } {
200202
let config
201203
let isYaml = false
@@ -214,8 +216,8 @@ class MiddlewareApp extends React.Component<Props, State> {
214216
}
215217
}
216218

217-
if (this.props.env) {
218-
config = resolveEnvsInValues(config, this.props.env)
219+
if (env) {
220+
config = resolveEnvsInValues(config, env)
219221
}
220222

221223
return {

0 commit comments

Comments
 (0)