Skip to content

Commit c65900c

Browse files
pantharshit00huv1k
authored andcommitted
Passed missing props from the Middlware (#912)
* fix: add shareEnabled option in the props * fix: pass fix endpoint from the props and removed unused redux code * fix: revert fixEndpoint removal from the store
1 parent 204fac7 commit c65900c

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

packages/graphql-playground-react/src/components/Playground.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export interface Props {
6262
subscriptionEndpoint?: string
6363
projectId?: string
6464
shareEnabled?: boolean
65-
adminAuthToken?: string
65+
fixedEndpoint?: boolean
6666
onSuccess?: (graphQLParams: any, response: any) => void
6767
isEndpoint?: boolean
6868
isApp?: boolean
@@ -302,6 +302,7 @@ export class Playground extends React.PureComponent<Props & ReduxProps, State> {
302302
) : (
303303
<GraphQLEditor
304304
shareEnabled={this.props.shareEnabled}
305+
fixedEndpoint={this.props.fixedEndpoint}
305306
schema={this.state.schema}
306307
/>
307308
)}

packages/graphql-playground-react/src/components/Playground/GraphQLEditor.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ import { ResponseRecord } from '../../state/sessions/reducers'
7575
export interface Props {
7676
onRef?: any
7777
shareEnabled?: boolean
78+
fixedEndpoint?: boolean
7879
schema?: GraphQLSchema
7980
}
8081

@@ -167,7 +168,10 @@ class GraphQLEditor extends React.PureComponent<Props & ReduxProps> {
167168
return (
168169
<Container>
169170
<EditorWrapper>
170-
<TopBar shareEnabled={this.props.shareEnabled} />
171+
<TopBar
172+
shareEnabled={this.props.shareEnabled}
173+
fixedEndpoint={this.props.fixedEndpoint}
174+
/>
171175
<EditorBar
172176
ref={this.setEditorBarComponent}
173177
onMouseDown={this.handleResizeStart}

packages/graphql-playground-react/src/components/PlaygroundWrapper.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export interface PlaygroundWrapperProps {
4444
subscriptionEndpoint?: string
4545
setTitle?: boolean
4646
settings?: ISettings
47+
shareEnabled?: string
48+
fixedEndpoint?: string
4749
folderName?: string
4850
configString?: string
4951
showNewWorkspace?: boolean
@@ -376,6 +378,7 @@ class PlaygroundWrapper extends React.Component<
376378
)}
377379
<Playground
378380
endpoint={this.state.endpoint}
381+
shareEnabled={this.props.shareEnabled}
379382
subscriptionEndpoint={this.state.subscriptionEndpoint}
380383
shareUrl={this.state.shareUrl}
381384
onChangeEndpoint={this.handleChangeEndpoint}
@@ -392,6 +395,7 @@ class PlaygroundWrapper extends React.Component<
392395
onSaveConfig={this.handleSaveConfig}
393396
onUpdateSessionCount={this.handleUpdateSessionCount}
394397
fixedEndpoints={Boolean(this.state.configString)}
398+
fixedEndpoint={this.props.fixedEndpoint}
395399
headers={combinedHeaders}
396400
configPath={this.props.configPath}
397401
workspaceName={

0 commit comments

Comments
 (0)