diff --git a/packages/graphql-playground-react/src/state/sessions/fetchingSagas.ts b/packages/graphql-playground-react/src/state/sessions/fetchingSagas.ts index 8cd89dcd2..212bf0029 100644 --- a/packages/graphql-playground-react/src/state/sessions/fetchingSagas.ts +++ b/packages/graphql-playground-react/src/state/sessions/fetchingSagas.ts @@ -137,7 +137,7 @@ function* runQuerySaga(action) { headers, credentials: settings['request.credentials'], } - + const { link, subscriptionClient } = linkCreator(lol) yield put(setCurrentQueryStartTime(new Date())) diff --git a/packages/graphql-playground-react/src/state/sessions/sagas.ts b/packages/graphql-playground-react/src/state/sessions/sagas.ts index dfb11c469..48e9f7053 100644 --- a/packages/graphql-playground-react/src/state/sessions/sagas.ts +++ b/packages/graphql-playground-react/src/state/sessions/sagas.ts @@ -191,8 +191,14 @@ function* addToHistory({ payload }) { function* prettifyQuery() { const { query } = yield select(getSelectedSession) const settings = yield select(getSettings) - const prettyQuery = prettify(query, settings['prettier.printWidth']) - yield put(editQuery(prettyQuery)) + try { + const prettyQuery = prettify(query, settings['prettier.printWidth']) + yield put(editQuery(prettyQuery)) + } catch (e) { + // TODO show erros somewhere + // tslint:disable-next-line + console.log(e) + } } export const sessionsSagas = [ diff --git a/packages/graphql-playground-react/src/utils.ts b/packages/graphql-playground-react/src/utils.ts index 55ec76b76..f672c7e09 100644 --- a/packages/graphql-playground-react/src/utils.ts +++ b/packages/graphql-playground-react/src/utils.ts @@ -13,14 +13,9 @@ export function safely(cb: any) { } export function prettify(query: string, printWidth: number) { - try { - return prettier.format(query, { - parser: 'graphql', - printWidth, - plugins: [graphql], - }) - } catch (e) { - //TODO show erros somewhere - console.log(e) - } + return prettier.format(query, { + parser: 'graphql', + printWidth, + plugins: [graphql], + }) }