Skip to content

Commit c6df141

Browse files
committed
Handle long responses graceful. Closes #179
1 parent ef72037 commit c6df141

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

packages/graphql-playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-playground",
3-
"version": "1.0.16",
3+
"version": "1.0.18",
44
"main": "./lib/lib.js",
55
"typings": "./lib/lib.d.ts",
66
"scripts": {

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ export class Playground extends React.PureComponent<Props & DocsState, State> {
181181
props.adminAuthToken.length > 0 &&
182182
props.adminAuthToken) ||
183183
localStorage.getItem('token'),
184-
response: undefined,
185184
selectUserOpen: false,
186185
selectUserSessionId: undefined,
187186
codeGenerationPopupOpen: false,
@@ -193,6 +192,7 @@ export class Playground extends React.PureComponent<Props & DocsState, State> {
193192
shareHttpHeaders: true,
194193
shareHistory: true,
195194
changed: false,
195+
response: undefined,
196196
}
197197

198198
if (typeof window === 'object') {
@@ -698,21 +698,27 @@ export class Playground extends React.PureComponent<Props & DocsState, State> {
698698
/>}
699699
{this.props.adminAuthToken &&
700700
this.state.selectUserOpen &&
701-
<SelectUserPopup
702-
isOpen={this.state.selectUserOpen}
703-
onRequestClose={this.handleCloseSelectUser}
704-
adminAuthToken={this.props.adminAuthToken}
705-
userFields={this.state.userFields}
706-
onSelectUser={this.handleUserSelection}
707-
endpointUrl={this.getSimpleEndpoint()}
708-
/>}
701+
this.renderUserPopup()}
709702
{this.state.codeGenerationPopupOpen &&
710703
this.renderCodeGenerationPopup()}
711704
</div>
712705
</ThemeProvider>
713706
)
714707
}
715708

709+
renderUserPopup() {
710+
return (
711+
<SelectUserPopup
712+
isOpen={this.state.selectUserOpen}
713+
onRequestClose={this.handleCloseSelectUser}
714+
adminAuthToken={this.props.adminAuthToken!}
715+
userFields={this.state.userFields}
716+
onSelectUser={this.handleUserSelection}
717+
endpointUrl={this.getSimpleEndpoint()}
718+
/>
719+
)
720+
}
721+
716722
renderCodeGenerationPopup() {
717723
const { sessions, selectedSessionIndex } = this.state
718724
const { isEndpoint } = this.props

packages/graphql-playground/src/styles/graphiql_dark.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,3 +1314,8 @@ li.CodeMirror-hint-active {
13141314
.history-popup .graphiql-container .queryWrap {
13151315
border-top: none;
13161316
}
1317+
1318+
.result-codemirror .CodeMirror-scroll {
1319+
max-width: 50vw;
1320+
margin-right: 10px;
1321+
}

0 commit comments

Comments
 (0)