mock-config-server 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,7 +10,9 @@ Object.defineProperty(exports, "getGraphQLInput", {
|
|
|
10
10
|
});
|
|
11
11
|
const getGraphQLInput = (request)=>{
|
|
12
12
|
if (request.method === 'GET') {
|
|
13
|
-
|
|
13
|
+
var _request_query, _request_query1;
|
|
14
|
+
const query = (_request_query = request.query) === null || _request_query === void 0 ? void 0 : _request_query.query;
|
|
15
|
+
const variables = (_request_query1 = request.query) === null || _request_query1 === void 0 ? void 0 : _request_query1.variables;
|
|
14
16
|
// ✅ important:
|
|
15
17
|
// if 'variables' was sent as encoded uri component then it already decoded into object and we do not need to use JSON.parse
|
|
16
18
|
return {
|
|
@@ -19,7 +21,9 @@ const getGraphQLInput = (request)=>{
|
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
23
|
if (request.method === 'POST') {
|
|
22
|
-
|
|
24
|
+
var _request_body, _request_body1;
|
|
25
|
+
const query = (_request_body = request.body) === null || _request_body === void 0 ? void 0 : _request_body.query;
|
|
26
|
+
const variables = (_request_body1 = request.body) === null || _request_body1 === void 0 ? void 0 : _request_body1.variables;
|
|
23
27
|
return {
|
|
24
28
|
query,
|
|
25
29
|
variables
|