Skip to content

Commit 7765333

Browse files
committed
better result viewer performance
1 parent 6ea5832 commit 7765333

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ class GraphQLEditor extends React.PureComponent<
365365
>
366366
Tracing
367367
</div>
368-
<ReponseTracing />
368+
<ReponseTracing open={this.props.responseTracingOpen} />
369369
</div>
370370
</div>
371371
</div>

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,13 @@ const TracingRows = styled.div`
7373
height: calc(100% + 116px);
7474
`
7575

76-
class ResponseTracing extends React.PureComponent<ReduxProps> {
76+
interface Props {
77+
open: boolean
78+
}
79+
80+
class ResponseTracing extends React.PureComponent<ReduxProps & Props> {
7781
render() {
78-
const { tracing, tracingSupported, startTime, endTime } = this.props
82+
const { tracing, tracingSupported, startTime, endTime, open } = this.props
7983
const requestMs =
8084
tracing && startTime
8185
? Math.abs(new Date(tracing.startTime).getTime() - startTime.getTime())
@@ -85,9 +89,10 @@ class ResponseTracing extends React.PureComponent<ReduxProps> {
8589
? Math.abs(endTime.getTime() - new Date(tracing.endTime).getTime())
8690
: 0
8791
const requestDuration = 1000 * 1000 * requestMs
92+
8893
return (
8994
<TracingWrapper>
90-
{tracing ? (
95+
{tracing && open ? (
9196
<TracingRows>
9297
<TracingRow
9398
path={['Request']}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ export class ResultViewer extends React.Component<Props, {}> {
6767
'Alt-Left': 'goGroupLeft',
6868
'Alt-Right': 'goGroupRight',
6969
},
70-
viewportMargin: Infinity,
7170
})
7271
}
7372

@@ -93,9 +92,6 @@ export class ResultViewer extends React.Component<Props, {}> {
9392
background: none;
9493
position: relative !important;
9594
}
96-
.result-codemirror :global(.CodeMirror-scroll) {
97-
overflow: auto !important;
98-
}
9995
`}</style>
10096
</div>
10197
)

0 commit comments

Comments
 (0)