From d465b64ed3c790bda230b07eb34c077463aaab49 Mon Sep 17 00:00:00 2001 From: Vincenzo Russo Date: Mon, 8 Jan 2018 13:31:02 +0000 Subject: [PATCH] Make 'credentials' configurable for GQL requests --- .../graphql-playground-react/src/components/MiddlewareApp.tsx | 1 + .../graphql-playground-react/src/components/Playground.tsx | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/graphql-playground-react/src/components/MiddlewareApp.tsx b/packages/graphql-playground-react/src/components/MiddlewareApp.tsx index 8d3325955..eddb15663 100644 --- a/packages/graphql-playground-react/src/components/MiddlewareApp.tsx +++ b/packages/graphql-playground-react/src/components/MiddlewareApp.tsx @@ -67,6 +67,7 @@ const defaultSettings = `{ "general.betaUpdates": false, "editor.theme": "dark", "editor.reuseHeaders": true, + "request.credentials": "omit", "tracing.hideTracingResponse": true }` diff --git a/packages/graphql-playground-react/src/components/Playground.tsx b/packages/graphql-playground-react/src/components/Playground.tsx index 0cefe3abe..816356539 100644 --- a/packages/graphql-playground-react/src/components/Playground.tsx +++ b/packages/graphql-playground-react/src/components/Playground.tsx @@ -1016,8 +1016,7 @@ export class Playground extends React.PureComponent { // tslint:disable-lin method: 'post', headers, - // TODO enable - // credentials: 'include', + credentials: this.props.settings["request.credentials"], body: JSON.stringify(graphQLParams), }).then(response => { if (typeof this.props.onSuccess === 'function') {