Skip to content

Commit 4c22d5f

Browse files
huv1ktimsuchanek
authored andcommitted
Fixes #774 (#775)
1 parent 7d7969f commit 4c22d5f

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

packages/graphql-playground-react/src/state/sessions/fetchingSagas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function* runQuerySaga(action) {
137137
headers,
138138
credentials: settings['request.credentials'],
139139
}
140-
140+
141141
const { link, subscriptionClient } = linkCreator(lol)
142142
yield put(setCurrentQueryStartTime(new Date()))
143143

packages/graphql-playground-react/src/state/sessions/sagas.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,14 @@ function* addToHistory({ payload }) {
191191
function* prettifyQuery() {
192192
const { query } = yield select(getSelectedSession)
193193
const settings = yield select(getSettings)
194-
const prettyQuery = prettify(query, settings['prettier.printWidth'])
195-
yield put(editQuery(prettyQuery))
194+
try {
195+
const prettyQuery = prettify(query, settings['prettier.printWidth'])
196+
yield put(editQuery(prettyQuery))
197+
} catch (e) {
198+
// TODO show erros somewhere
199+
// tslint:disable-next-line
200+
console.log(e)
201+
}
196202
}
197203

198204
export const sessionsSagas = [

packages/graphql-playground-react/src/utils.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,9 @@ export function safely(cb: any) {
1313
}
1414

1515
export function prettify(query: string, printWidth: number) {
16-
try {
17-
return prettier.format(query, {
18-
parser: 'graphql',
19-
printWidth,
20-
plugins: [graphql],
21-
})
22-
} catch (e) {
23-
//TODO show erros somewhere
24-
console.log(e)
25-
}
16+
return prettier.format(query, {
17+
parser: 'graphql',
18+
printWidth,
19+
plugins: [graphql],
20+
})
2621
}

0 commit comments

Comments
 (0)