From 8761374433d87e8b57e5ef488987dc137efca04c Mon Sep 17 00:00:00 2001 From: Douglas Muraoka Date: Mon, 15 Jul 2019 18:30:37 -0300 Subject: [PATCH 1/2] feat: Add client key into GraphQL console by default --- src/dashboard/Data/ApiConsole/GraphQLConsole.react.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dashboard/Data/ApiConsole/GraphQLConsole.react.js b/src/dashboard/Data/ApiConsole/GraphQLConsole.react.js index 070fe4b90a..e75db02f78 100644 --- a/src/dashboard/Data/ApiConsole/GraphQLConsole.react.js +++ b/src/dashboard/Data/ApiConsole/GraphQLConsole.react.js @@ -16,7 +16,7 @@ import styles from 'dashboard/Data/ApiConsole/ApiConsole.scss'; export default class GraphQLConsole extends Component { render() { - const { applicationId, graphQLServerURL, masterKey } = this.context.currentApp; + const { applicationId, clientKey, graphQLServerURL, masterKey } = this.context.currentApp; let content; if (!graphQLServerURL) { content = ( @@ -32,6 +32,7 @@ export default class GraphQLConsole extends Component { } else { const headers = { 'X-Parse-Application-Id': applicationId, + 'X-Parse-Client-Key': clientKey, 'X-Parse-Master-Key': masterKey } content = ( From 246276698b646089b7f4a76acf876f8e09e975e9 Mon Sep 17 00:00:00 2001 From: Douglas Muraoka Date: Tue, 16 Jul 2019 09:51:45 -0300 Subject: [PATCH 2/2] fix: Only set X-Parse-Client-Key when clientKey is defined --- src/dashboard/Data/ApiConsole/GraphQLConsole.react.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dashboard/Data/ApiConsole/GraphQLConsole.react.js b/src/dashboard/Data/ApiConsole/GraphQLConsole.react.js index e75db02f78..5a9b58bcd5 100644 --- a/src/dashboard/Data/ApiConsole/GraphQLConsole.react.js +++ b/src/dashboard/Data/ApiConsole/GraphQLConsole.react.js @@ -32,9 +32,11 @@ export default class GraphQLConsole extends Component { } else { const headers = { 'X-Parse-Application-Id': applicationId, - 'X-Parse-Client-Key': clientKey, 'X-Parse-Master-Key': masterKey } + if (clientKey) { + headers['X-Parse-Client-Key'] = clientKey + } content = (