@webiny/handler-graphql 5.25.0-beta.3 → 5.25.0-beta.4
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.
- package/debugPlugins.d.ts +2 -2
- package/debugPlugins.js +5 -11
- package/debugPlugins.js.map +1 -1
- package/package.json +10 -10
package/debugPlugins.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GraphQLAfterQueryPlugin
|
|
1
|
+
import { GraphQLAfterQueryPlugin } from "./types";
|
|
2
2
|
import { Context, ContextPlugin } from "@webiny/handler/types";
|
|
3
3
|
interface Log {
|
|
4
4
|
method: string;
|
|
@@ -9,5 +9,5 @@ interface DebugContext extends Context {
|
|
|
9
9
|
logs?: Log[];
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
declare const _default: () => (ContextPlugin<DebugContext, Context, Context, Context, Context, Context, Context, Context, Context, Context> |
|
|
12
|
+
declare const _default: () => (ContextPlugin<DebugContext, Context, Context, Context, Context, Context, Context, Context, Context, Context> | GraphQLAfterQueryPlugin<DebugContext>)[];
|
|
13
13
|
export default _default;
|
package/debugPlugins.js
CHANGED
|
@@ -27,16 +27,6 @@ var _default = () => [{
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
}, {
|
|
31
|
-
type: "graphql-before-query",
|
|
32
|
-
|
|
33
|
-
apply({
|
|
34
|
-
context
|
|
35
|
-
}) {
|
|
36
|
-
// Empty logs
|
|
37
|
-
context.debug.logs = [];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
30
|
}, {
|
|
41
31
|
type: "graphql-after-query",
|
|
42
32
|
|
|
@@ -45,8 +35,12 @@ var _default = () => [{
|
|
|
45
35
|
context
|
|
46
36
|
}) {
|
|
47
37
|
result["extensions"] = {
|
|
48
|
-
console: context.debug.logs || []
|
|
38
|
+
console: [...(context.debug.logs || [])]
|
|
49
39
|
};
|
|
40
|
+
|
|
41
|
+
if (context.debug.logs) {
|
|
42
|
+
context.debug.logs.length = 0;
|
|
43
|
+
}
|
|
50
44
|
}
|
|
51
45
|
|
|
52
46
|
}];
|
package/debugPlugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["debugPlugins.ts"],"names":["type","apply","context","debug","logs","method","args","push","result","console"],"mappings":";;;;;;;AAAA;;eAce,MAAM,CACjB;AACIA,EAAAA,IAAI,EAAE,SADV;;AAEIC,EAAAA,KAAK,CAACC,OAAD,EAAU;AACX,QAAI,CAACA,OAAO,CAACC,KAAb,EAAoB;AAChBD,MAAAA,OAAO,CAACC,KAAR,GAAgB,EAAhB;AACH;;
|
|
1
|
+
{"version":3,"sources":["debugPlugins.ts"],"names":["type","apply","context","debug","logs","method","args","push","result","console","length"],"mappings":";;;;;;;AAAA;;eAce,MAAM,CACjB;AACIA,EAAAA,IAAI,EAAE,SADV;;AAEIC,EAAAA,KAAK,CAACC,OAAD,EAAU;AACX,QAAI,CAACA,OAAO,CAACC,KAAb,EAAoB;AAChBD,MAAAA,OAAO,CAACC,KAAR,GAAgB,EAAhB;AACH;;AAED,QAAI,CAACD,OAAO,CAACC,KAAR,CAAcC,IAAnB,EAAyB;AACrBF,MAAAA,OAAO,CAACC,KAAR,CAAcC,IAAd,GAAqB,EAArB;AACH;;AAED,4CAAiB,CAACC,MAAD,EAASC,IAAT,KAAkB;AAC9BJ,MAAAA,OAAO,CAACC,KAAR,CAAcC,IAAf,CAA8BG,IAA9B,CAAmC;AAAEF,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAnC;AACH,KAFD;AAGH;;AAdL,CADiB,EAiBjB;AACIN,EAAAA,IAAI,EAAE,qBADV;;AAEIC,EAAAA,KAAK,CAAC;AAAEO,IAAAA,MAAF;AAAUN,IAAAA;AAAV,GAAD,EAAsB;AACvBM,IAAAA,MAAM,CAAC,YAAD,CAAN,GAAuB;AAAEC,MAAAA,OAAO,EAAE,CAAC,IAAIP,OAAO,CAACC,KAAR,CAAcC,IAAd,IAAsB,EAA1B,CAAD;AAAX,KAAvB;;AACA,QAAIF,OAAO,CAACC,KAAR,CAAcC,IAAlB,EAAwB;AACpBF,MAAAA,OAAO,CAACC,KAAR,CAAcC,IAAd,CAAmBM,MAAnB,GAA4B,CAA5B;AACH;AACJ;;AAPL,CAjBiB,C","sourcesContent":["import { interceptConsole } from \"./interceptConsole\";\nimport { GraphQLAfterQueryPlugin } from \"./types\";\nimport { Context, ContextPlugin } from \"@webiny/handler/types\";\n\ninterface Log {\n method: string;\n args: any;\n}\ninterface DebugContext extends Context {\n debug: {\n logs?: Log[];\n };\n}\n\nexport default () => [\n {\n type: \"context\",\n apply(context) {\n if (!context.debug) {\n context.debug = {};\n }\n\n if (!context.debug.logs) {\n context.debug.logs = [];\n }\n\n interceptConsole((method, args) => {\n (context.debug.logs as Log[]).push({ method, args });\n });\n }\n } as ContextPlugin<DebugContext>,\n {\n type: \"graphql-after-query\",\n apply({ result, context }) {\n result[\"extensions\"] = { console: [...(context.debug.logs || [])] };\n if (context.debug.logs) {\n context.debug.logs.length = 0;\n }\n }\n } as GraphQLAfterQueryPlugin<DebugContext>\n];\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/handler-graphql",
|
|
3
|
-
"version": "5.25.0-beta.
|
|
3
|
+
"version": "5.25.0-beta.4",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "7.17.7",
|
|
18
18
|
"@graphql-tools/schema": "7.1.5",
|
|
19
|
-
"@webiny/error": "5.25.0-beta.
|
|
20
|
-
"@webiny/handler": "5.25.0-beta.
|
|
21
|
-
"@webiny/handler-http": "5.25.0-beta.
|
|
22
|
-
"@webiny/plugins": "5.25.0-beta.
|
|
23
|
-
"@webiny/utils": "5.25.0-beta.
|
|
19
|
+
"@webiny/error": "5.25.0-beta.4",
|
|
20
|
+
"@webiny/handler": "5.25.0-beta.4",
|
|
21
|
+
"@webiny/handler-http": "5.25.0-beta.4",
|
|
22
|
+
"@webiny/plugins": "5.25.0-beta.4",
|
|
23
|
+
"@webiny/utils": "5.25.0-beta.4",
|
|
24
24
|
"boolean": "3.2.0",
|
|
25
25
|
"graphql": "15.8.0",
|
|
26
26
|
"graphql-scalars": "1.12.0",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"@babel/cli": "^7.16.0",
|
|
31
31
|
"@babel/core": "^7.16.0",
|
|
32
32
|
"@babel/preset-env": "^7.16.4",
|
|
33
|
-
"@webiny/cli": "^5.25.0-beta.
|
|
34
|
-
"@webiny/handler-args": "^5.25.0-beta.
|
|
35
|
-
"@webiny/project-utils": "^5.25.0-beta.
|
|
33
|
+
"@webiny/cli": "^5.25.0-beta.4",
|
|
34
|
+
"@webiny/handler-args": "^5.25.0-beta.4",
|
|
35
|
+
"@webiny/project-utils": "^5.25.0-beta.4",
|
|
36
36
|
"jest": "^26.6.3",
|
|
37
37
|
"jest-mock-console": "^1.0.0",
|
|
38
38
|
"rimraf": "^3.0.2",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"build": "yarn webiny run build",
|
|
47
47
|
"watch": "yarn webiny run watch"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "625ab53457e211940b30b1fe86add4f19f63c8b0"
|
|
50
50
|
}
|