@cedarjs/graphql-server 0.6.1-next.0 → 0.7.0
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/dist/cjs/cors.d.ts +10 -0
- package/dist/cjs/cors.d.ts.map +1 -0
- package/dist/cjs/cors.js +70 -0
- package/dist/cjs/createGraphQLYoga.d.ts +6 -0
- package/dist/cjs/createGraphQLYoga.d.ts.map +1 -0
- package/dist/cjs/createGraphQLYoga.js +178 -0
- package/dist/cjs/directives/makeDirectives.d.ts +8 -0
- package/dist/cjs/directives/makeDirectives.d.ts.map +1 -0
- package/dist/cjs/directives/makeDirectives.js +89 -0
- package/dist/cjs/errors.d.ts +28 -0
- package/dist/cjs/errors.d.ts.map +1 -0
- package/dist/cjs/errors.js +98 -0
- package/dist/cjs/functions/graphql.d.ts +15 -0
- package/dist/cjs/functions/graphql.d.ts.map +1 -0
- package/dist/cjs/functions/graphql.js +141 -0
- package/dist/cjs/functions/useRequireAuth.d.ts +12 -0
- package/dist/cjs/functions/useRequireAuth.d.ts.map +1 -0
- package/dist/cjs/functions/useRequireAuth.js +70 -0
- package/dist/cjs/global.api-auto-imports.d.ts +5 -0
- package/dist/cjs/global.api-auto-imports.d.ts.map +1 -0
- package/dist/cjs/global.api-auto-imports.js +1 -0
- package/dist/cjs/globalContext.d.ts +25 -0
- package/dist/cjs/globalContext.d.ts.map +1 -0
- package/dist/cjs/globalContext.js +55 -0
- package/dist/cjs/globalContextStore.d.ts +9 -0
- package/dist/cjs/globalContextStore.d.ts.map +1 -0
- package/dist/cjs/globalContextStore.js +35 -0
- package/dist/cjs/graphiql.d.ts +8 -0
- package/dist/cjs/graphiql.d.ts.map +1 -0
- package/dist/cjs/graphiql.js +45 -0
- package/dist/cjs/index.d.ts +14 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +75 -0
- package/dist/cjs/introspection.d.ts +7 -0
- package/dist/cjs/introspection.d.ts.map +1 -0
- package/dist/cjs/introspection.js +36 -0
- package/dist/cjs/makeMergedSchema.d.ts +17 -0
- package/dist/cjs/makeMergedSchema.d.ts.map +1 -0
- package/dist/cjs/makeMergedSchema.js +283 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/plugins/index.d.ts +10 -0
- package/dist/cjs/plugins/index.d.ts.map +1 -0
- package/dist/cjs/plugins/index.js +52 -0
- package/dist/cjs/plugins/useArmor.d.ts +4 -0
- package/dist/cjs/plugins/useArmor.d.ts.map +1 -0
- package/dist/cjs/plugins/useArmor.js +69 -0
- package/dist/cjs/plugins/useRedwoodAuthContext.d.ts +9 -0
- package/dist/cjs/plugins/useRedwoodAuthContext.d.ts.map +1 -0
- package/dist/cjs/plugins/useRedwoodAuthContext.js +61 -0
- package/dist/cjs/plugins/useRedwoodDirective.d.ts +83 -0
- package/dist/cjs/plugins/useRedwoodDirective.d.ts.map +1 -0
- package/dist/cjs/plugins/useRedwoodDirective.js +166 -0
- package/dist/cjs/plugins/useRedwoodError.d.ts +20 -0
- package/dist/cjs/plugins/useRedwoodError.d.ts.map +1 -0
- package/dist/cjs/plugins/useRedwoodError.js +63 -0
- package/dist/cjs/plugins/useRedwoodGlobalContextSetter.d.ts +9 -0
- package/dist/cjs/plugins/useRedwoodGlobalContextSetter.d.ts.map +1 -0
- package/dist/cjs/plugins/useRedwoodGlobalContextSetter.js +35 -0
- package/dist/cjs/plugins/useRedwoodLogger.d.ts +115 -0
- package/dist/cjs/plugins/useRedwoodLogger.d.ts.map +1 -0
- package/dist/cjs/plugins/useRedwoodLogger.js +149 -0
- package/dist/cjs/plugins/useRedwoodOpenTelemetry.d.ts +22 -0
- package/dist/cjs/plugins/useRedwoodOpenTelemetry.d.ts.map +1 -0
- package/dist/cjs/plugins/useRedwoodOpenTelemetry.js +156 -0
- package/dist/cjs/plugins/useRedwoodPopulateContext.d.ts +9 -0
- package/dist/cjs/plugins/useRedwoodPopulateContext.d.ts.map +1 -0
- package/dist/cjs/plugins/useRedwoodPopulateContext.js +35 -0
- package/dist/cjs/plugins/useRedwoodTrustedDocuments.d.ts +23 -0
- package/dist/cjs/plugins/useRedwoodTrustedDocuments.d.ts.map +1 -0
- package/dist/cjs/plugins/useRedwoodTrustedDocuments.js +80 -0
- package/dist/cjs/rootSchema.d.ts +25 -0
- package/dist/cjs/rootSchema.d.ts.map +1 -0
- package/dist/cjs/rootSchema.js +97 -0
- package/dist/cjs/subscriptions/makeSubscriptions.d.ts +18 -0
- package/dist/cjs/subscriptions/makeSubscriptions.d.ts.map +1 -0
- package/dist/cjs/subscriptions/makeSubscriptions.js +40 -0
- package/dist/cjs/types.d.ts +215 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +16 -0
- package/dist/cors.js +2 -26
- package/dist/createGraphQLYoga.d.ts +1 -1
- package/dist/createGraphQLYoga.d.ts.map +1 -1
- package/dist/createGraphQLYoga.js +45 -59
- package/dist/directives/makeDirectives.d.ts +1 -1
- package/dist/directives/makeDirectives.d.ts.map +1 -1
- package/dist/directives/makeDirectives.js +9 -36
- package/dist/errors.js +5 -36
- package/dist/functions/graphql.d.ts +1 -1
- package/dist/functions/graphql.d.ts.map +1 -1
- package/dist/functions/graphql.js +6 -30
- package/dist/functions/useRequireAuth.d.ts +1 -1
- package/dist/functions/useRequireAuth.d.ts.map +1 -1
- package/dist/functions/useRequireAuth.js +9 -33
- package/dist/global.api-auto-imports.js +0 -1
- package/dist/globalContext.js +6 -32
- package/dist/globalContextStore.d.ts +1 -1
- package/dist/globalContextStore.d.ts.map +1 -1
- package/dist/globalContextStore.js +4 -28
- package/dist/graphiql.d.ts +1 -1
- package/dist/graphiql.d.ts.map +1 -1
- package/dist/graphiql.js +2 -26
- package/dist/index.d.ts +12 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -82
- package/dist/introspection.d.ts +1 -1
- package/dist/introspection.d.ts.map +1 -1
- package/dist/introspection.js +2 -26
- package/dist/makeMergedSchema.d.ts +3 -3
- package/dist/makeMergedSchema.d.ts.map +1 -1
- package/dist/makeMergedSchema.js +19 -49
- package/dist/plugins/index.d.ts +9 -9
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +11 -43
- package/dist/plugins/useArmor.d.ts +2 -2
- package/dist/plugins/useArmor.d.ts.map +1 -1
- package/dist/plugins/useArmor.js +4 -28
- package/dist/plugins/useRedwoodAuthContext.d.ts +1 -1
- package/dist/plugins/useRedwoodAuthContext.d.ts.map +1 -1
- package/dist/plugins/useRedwoodAuthContext.js +4 -28
- package/dist/plugins/useRedwoodDirective.js +9 -37
- package/dist/plugins/useRedwoodError.d.ts +1 -1
- package/dist/plugins/useRedwoodError.d.ts.map +1 -1
- package/dist/plugins/useRedwoodError.js +10 -31
- package/dist/plugins/useRedwoodGlobalContextSetter.d.ts +1 -1
- package/dist/plugins/useRedwoodGlobalContextSetter.d.ts.map +1 -1
- package/dist/plugins/useRedwoodGlobalContextSetter.js +4 -28
- package/dist/plugins/useRedwoodLogger.d.ts +1 -1
- package/dist/plugins/useRedwoodLogger.d.ts.map +1 -1
- package/dist/plugins/useRedwoodLogger.js +10 -34
- package/dist/plugins/useRedwoodOpenTelemetry.d.ts +1 -1
- package/dist/plugins/useRedwoodOpenTelemetry.d.ts.map +1 -1
- package/dist/plugins/useRedwoodOpenTelemetry.js +11 -46
- package/dist/plugins/useRedwoodPopulateContext.d.ts +1 -1
- package/dist/plugins/useRedwoodPopulateContext.d.ts.map +1 -1
- package/dist/plugins/useRedwoodPopulateContext.js +2 -26
- package/dist/plugins/useRedwoodTrustedDocuments.d.ts +1 -1
- package/dist/plugins/useRedwoodTrustedDocuments.d.ts.map +1 -1
- package/dist/plugins/useRedwoodTrustedDocuments.js +4 -28
- package/dist/rootSchema.js +26 -54
- package/dist/subscriptions/makeSubscriptions.js +5 -29
- package/dist/types.d.ts +4 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -16
- package/package.json +27 -10
- package/dist/plugins/__fixtures__/common.d.ts +0 -9
- package/dist/plugins/__fixtures__/common.d.ts.map +0 -1
- package/dist/plugins/__fixtures__/envelop-testing.d.ts +0 -55
- package/dist/plugins/__fixtures__/envelop-testing.d.ts.map +0 -1
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var useRedwoodPopulateContext_exports = {};
|
|
20
|
-
__export(useRedwoodPopulateContext_exports, {
|
|
21
|
-
useRedwoodPopulateContext: () => useRedwoodPopulateContext
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(useRedwoodPopulateContext_exports);
|
|
24
1
|
const useRedwoodPopulateContext = (populateContextBuilder) => {
|
|
25
2
|
return {
|
|
26
3
|
async onContextBuilding({ context, extendContext }) {
|
|
@@ -29,7 +6,6 @@ const useRedwoodPopulateContext = (populateContextBuilder) => {
|
|
|
29
6
|
}
|
|
30
7
|
};
|
|
31
8
|
};
|
|
32
|
-
|
|
33
|
-
0 && (module.exports = {
|
|
9
|
+
export {
|
|
34
10
|
useRedwoodPopulateContext
|
|
35
|
-
}
|
|
11
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UsePersistedOperationsOptions } from '@graphql-yoga/plugin-persisted-operations';
|
|
2
2
|
import type { Plugin } from 'graphql-yoga';
|
|
3
|
-
import type { RedwoodGraphQLContext } from '../types';
|
|
3
|
+
import type { RedwoodGraphQLContext } from '../types.js';
|
|
4
4
|
export type RedwoodTrustedDocumentOptions = Omit<UsePersistedOperationsOptions, 'getPersistedOperation'> & {
|
|
5
5
|
/**
|
|
6
6
|
* Whether to disable the plugin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRedwoodTrustedDocuments.d.ts","sourceRoot":"","sources":["../../src/plugins/useRedwoodTrustedDocuments.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAA;AAC9F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useRedwoodTrustedDocuments.d.ts","sourceRoot":"","sources":["../../src/plugins/useRedwoodTrustedDocuments.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2CAA2C,CAAA;AAC9F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAExD,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAC9C,6BAA6B,EAC7B,uBAAuB,CACxB,GAAG;IACF;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACzC,GAAG,CACE;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,GAC5D;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAAE,CAChE,CAAA;AAoEH,eAAO,MAAM,0BAA0B,YAC5B,6BAA6B,KACrC,MAAM,CAAC,qBAAqB,CA8B9B,CAAA"}
|
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var useRedwoodTrustedDocuments_exports = {};
|
|
20
|
-
__export(useRedwoodTrustedDocuments_exports, {
|
|
21
|
-
useRedwoodTrustedDocuments: () => useRedwoodTrustedDocuments
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(useRedwoodTrustedDocuments_exports);
|
|
24
|
-
var import_plugin_persisted_operations = require("@graphql-yoga/plugin-persisted-operations");
|
|
1
|
+
import { usePersistedOperations } from "@graphql-yoga/plugin-persisted-operations";
|
|
25
2
|
const REDWOOD__AUTH_GET_CURRENT_USER_QUERY = '{"query":"query __REDWOOD__AUTH_GET_CURRENT_USER { redwood { currentUser } }"}';
|
|
26
3
|
const CEDAR__STUDIO_RESYNC_MAIL_RENDERERS_MUTATION = '{"query":"mutation { resyncMailRenderers }"}';
|
|
27
4
|
const CEDAR__STUDIO_TEMPLATE_MUTATION = '{"query":"mutation { resyncMailTemplate }"}';
|
|
@@ -47,7 +24,7 @@ const allowCedarStudioResyncMailMutations = async (request) => {
|
|
|
47
24
|
return hasContentType && isAllowedQuery;
|
|
48
25
|
};
|
|
49
26
|
const useRedwoodTrustedDocuments = (options) => {
|
|
50
|
-
return
|
|
27
|
+
return usePersistedOperations({
|
|
51
28
|
...options,
|
|
52
29
|
customErrors: {
|
|
53
30
|
persistedQueryOnly: "Use Trusted Only!",
|
|
@@ -74,7 +51,6 @@ const useRedwoodTrustedDocuments = (options) => {
|
|
|
74
51
|
}
|
|
75
52
|
});
|
|
76
53
|
};
|
|
77
|
-
|
|
78
|
-
0 && (module.exports = {
|
|
54
|
+
export {
|
|
79
55
|
useRedwoodTrustedDocuments
|
|
80
|
-
}
|
|
56
|
+
};
|
package/dist/rootSchema.js
CHANGED
|
@@ -1,42 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var rootSchema_exports = {};
|
|
30
|
-
__export(rootSchema_exports, {
|
|
31
|
-
resolvers: () => resolvers,
|
|
32
|
-
scalarSchemas: () => scalarSchemas,
|
|
33
|
-
schema: () => schema
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(rootSchema_exports);
|
|
36
|
-
var import_graphql_scalars = require("graphql-scalars");
|
|
37
|
-
var import_graphql_tag = __toESM(require("graphql-tag"));
|
|
38
|
-
var import_api = require("@cedarjs/api");
|
|
39
|
-
const schema = import_graphql_tag.default`
|
|
1
|
+
import {
|
|
2
|
+
BigIntResolver,
|
|
3
|
+
DateResolver,
|
|
4
|
+
TimeResolver,
|
|
5
|
+
DateTimeResolver,
|
|
6
|
+
JSONResolver,
|
|
7
|
+
JSONObjectResolver,
|
|
8
|
+
ByteResolver
|
|
9
|
+
} from "graphql-scalars";
|
|
10
|
+
import { gql } from "graphql-tag";
|
|
11
|
+
import { prismaVersion, redwoodVersion, cedarjsVersion } from "@cedarjs/api";
|
|
12
|
+
const schema = gql`
|
|
40
13
|
scalar BigInt
|
|
41
14
|
scalar Date
|
|
42
15
|
scalar Time
|
|
@@ -70,38 +43,37 @@ const schema = import_graphql_tag.default`
|
|
|
70
43
|
}
|
|
71
44
|
`;
|
|
72
45
|
const scalarSchemas = {
|
|
73
|
-
File:
|
|
46
|
+
File: gql`
|
|
74
47
|
scalar File
|
|
75
48
|
`
|
|
76
49
|
};
|
|
77
50
|
const resolvers = {
|
|
78
|
-
BigInt:
|
|
79
|
-
Date:
|
|
80
|
-
Time:
|
|
81
|
-
DateTime:
|
|
82
|
-
JSON:
|
|
83
|
-
JSONObject:
|
|
51
|
+
BigInt: BigIntResolver,
|
|
52
|
+
Date: DateResolver,
|
|
53
|
+
Time: TimeResolver,
|
|
54
|
+
DateTime: DateTimeResolver,
|
|
55
|
+
JSON: JSONResolver,
|
|
56
|
+
JSONObject: JSONObjectResolver,
|
|
84
57
|
Query: {
|
|
85
58
|
redwood: () => ({
|
|
86
|
-
version:
|
|
87
|
-
prismaVersion
|
|
59
|
+
version: redwoodVersion,
|
|
60
|
+
prismaVersion,
|
|
88
61
|
currentUser: (_args, context) => {
|
|
89
62
|
return context?.currentUser;
|
|
90
63
|
}
|
|
91
64
|
}),
|
|
92
65
|
cedarjs: () => ({
|
|
93
|
-
version:
|
|
94
|
-
prismaVersion
|
|
66
|
+
version: cedarjsVersion,
|
|
67
|
+
prismaVersion,
|
|
95
68
|
currentUser: (_args, context) => {
|
|
96
69
|
return context?.currentUser;
|
|
97
70
|
}
|
|
98
71
|
})
|
|
99
72
|
},
|
|
100
|
-
Byte:
|
|
73
|
+
Byte: ByteResolver
|
|
101
74
|
};
|
|
102
|
-
|
|
103
|
-
0 && (module.exports = {
|
|
75
|
+
export {
|
|
104
76
|
resolvers,
|
|
105
77
|
scalarSchemas,
|
|
106
78
|
schema
|
|
107
|
-
}
|
|
79
|
+
};
|
|
@@ -1,40 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var makeSubscriptions_exports = {};
|
|
20
|
-
__export(makeSubscriptions_exports, {
|
|
21
|
-
makeSubscriptions: () => makeSubscriptions
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(makeSubscriptions_exports);
|
|
24
1
|
const makeSubscriptions = (SubscriptionGlobs) => {
|
|
25
2
|
return Object.entries(SubscriptionGlobs).flatMap(
|
|
26
|
-
([importedGlobName,
|
|
3
|
+
([importedGlobName, exports]) => {
|
|
27
4
|
const [SubscriptionNameFromFile] = importedGlobName.split("_").slice(-2);
|
|
28
5
|
const subscription = {
|
|
29
|
-
schema:
|
|
30
|
-
resolvers:
|
|
6
|
+
schema: exports.schema,
|
|
7
|
+
resolvers: exports[SubscriptionNameFromFile] || exports.default,
|
|
31
8
|
name: SubscriptionNameFromFile
|
|
32
9
|
};
|
|
33
10
|
return [subscription];
|
|
34
11
|
}
|
|
35
12
|
);
|
|
36
13
|
};
|
|
37
|
-
|
|
38
|
-
0 && (module.exports = {
|
|
14
|
+
export {
|
|
39
15
|
makeSubscriptions
|
|
40
|
-
}
|
|
16
|
+
};
|
package/dist/types.d.ts
CHANGED
|
@@ -7,10 +7,10 @@ import type { Plugin } from 'graphql-yoga';
|
|
|
7
7
|
import type { AuthContextPayload, Decoder } from '@cedarjs/api';
|
|
8
8
|
import type { CorsConfig } from '@cedarjs/api';
|
|
9
9
|
import type { RedwoodRealtimeOptions } from '@cedarjs/realtime';
|
|
10
|
-
import type { DirectiveGlobImports } from './directives/makeDirectives';
|
|
11
|
-
import type { useRedwoodDirectiveReturn, DirectivePluginOptions } from './plugins/useRedwoodDirective';
|
|
12
|
-
import type { LoggerConfig } from './plugins/useRedwoodLogger';
|
|
13
|
-
import type { RedwoodTrustedDocumentOptions } from './plugins/useRedwoodTrustedDocuments';
|
|
10
|
+
import type { DirectiveGlobImports } from './directives/makeDirectives.js';
|
|
11
|
+
import type { useRedwoodDirectiveReturn, DirectivePluginOptions } from './plugins/useRedwoodDirective.js';
|
|
12
|
+
import type { LoggerConfig } from './plugins/useRedwoodLogger.js';
|
|
13
|
+
import type { RedwoodTrustedDocumentOptions } from './plugins/useRedwoodTrustedDocuments.js';
|
|
14
14
|
export type Resolver = (...args: unknown[]) => unknown;
|
|
15
15
|
export type Services = {
|
|
16
16
|
[funcName: string]: Resolver;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAC1E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,YAAY,CAAA;AAChF,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACb,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AA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,CAAC,EAAE,iBAAiB,CAAA;IAErC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,EAAE,CAAA;IAEjC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAE5B;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,sBAAsB,CAAA;IAE/C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,sBAAsB,CAAA;IAEjC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,6BAA6B,CAAA;IAEhD;;OAEG;IACH,oBAAoB,CAAC,EAAE,0BAA0B,CAAA;IAEjD;;;;;OAKG;IACH,cAAc,CAAC,EAAE,mBAAmB,CAAA;CACrC,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAA;AAEtD,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,kBAAkB,EAClB,eAAe,GAAG,wBAAwB,CAC3C,CAAA"}
|
package/dist/types.js
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var types_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(types_exports);
|
package/package.json
CHANGED
|
@@ -1,30 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/graphql-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
7
7
|
"directory": "packages/graphql-server"
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
|
-
"
|
|
10
|
+
"type": "module",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"require": {
|
|
18
|
+
"types": "./dist/cjs/index.d.ts",
|
|
19
|
+
"default": "./dist/cjs/index.js"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
11
23
|
"types": "./dist/index.d.ts",
|
|
12
24
|
"files": [
|
|
13
25
|
"dist"
|
|
14
26
|
],
|
|
15
27
|
"scripts": {
|
|
16
|
-
"build": "tsx ./build.mts
|
|
28
|
+
"build": "tsx ./build.mts",
|
|
17
29
|
"build:pack": "yarn pack -o cedarjs-graphql-server.tgz",
|
|
18
|
-
"build:types": "tsc --build --verbose ./tsconfig.json",
|
|
30
|
+
"build:types": "tsc --build --verbose ./tsconfig.build.json",
|
|
31
|
+
"build:types-cjs": "tsc --build --verbose ./tsconfig.cjs.json",
|
|
19
32
|
"build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"",
|
|
33
|
+
"check:attw": "yarn rw-fwtools-attw",
|
|
34
|
+
"check:package": "concurrently npm:check:attw yarn:publint",
|
|
20
35
|
"prepublishOnly": "NODE_ENV=production yarn build",
|
|
21
36
|
"test": "yarn vitest run src/",
|
|
22
37
|
"test:watch": "yarn test --watch"
|
|
23
38
|
},
|
|
24
39
|
"dependencies": {
|
|
25
40
|
"@babel/runtime-corejs3": "7.27.6",
|
|
26
|
-
"@cedarjs/api": "0.
|
|
27
|
-
"@cedarjs/context": "0.
|
|
41
|
+
"@cedarjs/api": "0.7.0",
|
|
42
|
+
"@cedarjs/context": "0.7.0",
|
|
28
43
|
"@envelop/core": "5.0.2",
|
|
29
44
|
"@envelop/depth-limit": "4.0.0",
|
|
30
45
|
"@envelop/disable-introspection": "6.0.0",
|
|
@@ -47,9 +62,9 @@
|
|
|
47
62
|
"devDependencies": {
|
|
48
63
|
"@babel/cli": "7.27.2",
|
|
49
64
|
"@babel/core": "^7.26.10",
|
|
50
|
-
"@cedarjs/framework-tools": "0.
|
|
51
|
-
"@cedarjs/project-config": "0.
|
|
52
|
-
"@cedarjs/realtime": "0.
|
|
65
|
+
"@cedarjs/framework-tools": "0.7.0",
|
|
66
|
+
"@cedarjs/project-config": "0.7.0",
|
|
67
|
+
"@cedarjs/realtime": "0.7.0",
|
|
53
68
|
"@envelop/types": "5.0.0",
|
|
54
69
|
"@types/aws-lambda": "8.10.152",
|
|
55
70
|
"@types/jsonwebtoken": "9.0.10",
|
|
@@ -57,7 +72,9 @@
|
|
|
57
72
|
"@types/uuid": "10.0.0",
|
|
58
73
|
"@whatwg-node/fetch": "0.9.21",
|
|
59
74
|
"@whatwg-node/promise-helpers": "^1.3.0",
|
|
75
|
+
"concurrently": "8.2.2",
|
|
60
76
|
"jsonwebtoken": "9.0.2",
|
|
77
|
+
"publint": "0.3.12",
|
|
61
78
|
"tsx": "4.20.3",
|
|
62
79
|
"typescript": "5.6.2",
|
|
63
80
|
"vitest": "3.2.4"
|
|
@@ -65,5 +82,5 @@
|
|
|
65
82
|
"publishConfig": {
|
|
66
83
|
"access": "public"
|
|
67
84
|
},
|
|
68
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "9e720ea4b6ca8306d466378104f532f818015531"
|
|
69
86
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const testSchema: import("graphql").GraphQLSchema;
|
|
2
|
-
export declare const testLiveSchema: import("graphql").GraphQLSchema;
|
|
3
|
-
export declare const testQuery = "\n query meQuery {\n me {\n id\n name\n }\n }\n";
|
|
4
|
-
export declare const testFilteredQuery = "\n query FilteredQuery {\n me {\n id\n name\n }\n }\n";
|
|
5
|
-
export declare const testErrorQuery = "\n query forbiddenUserQuery {\n forbiddenUser {\n id\n name\n }\n }\n";
|
|
6
|
-
export declare const testLiveQuery = "\n query meQuery @live {\n me {\n id\n name\n }\n }\n";
|
|
7
|
-
export declare const testParseErrorQuery = "\n query ParseErrorQuery {\n me {\n id\n name\n unknown_field\n }\n }\n";
|
|
8
|
-
export declare const testValidationErrorQuery = "\n query ValidationErrorQuery(id: Int!) {\n getUser(id: 'one') {\n id\n name\n }\n }\n";
|
|
9
|
-
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/plugins/__fixtures__/common.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,iCAiCrB,CAAA;AAEF,eAAO,MAAM,cAAc,iCAgDzB,CAAA;AACF,eAAO,MAAM,SAAS,sEAOrB,CAAA;AAED,eAAO,MAAM,iBAAiB,4EAO7B,CAAA;AAED,eAAO,MAAM,cAAc,4FAO1B,CAAA;AAED,eAAO,MAAM,aAAa,4EAOzB,CAAA;AAED,eAAO,MAAM,mBAAmB,mGAQ/B,CAAA;AAED,eAAO,MAAM,wBAAwB,6GAOpC,CAAA"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { envelop } from '@envelop/core';
|
|
2
|
-
import type { GetEnvelopedFn, Plugin } from '@envelop/types';
|
|
3
|
-
import type { DocumentNode, ExecutionResult, GraphQLSchema } from 'graphql';
|
|
4
|
-
export declare const useGraphQLJSEngine: () => Plugin<{}>;
|
|
5
|
-
export type ModifyPluginsFn = (plugins: Plugin<any>[]) => Plugin<any>[];
|
|
6
|
-
export type PhaseReplacementParams = {
|
|
7
|
-
phase: 'parse';
|
|
8
|
-
fn: ReturnType<GetEnvelopedFn<any>>['parse'];
|
|
9
|
-
} | {
|
|
10
|
-
phase: 'validate';
|
|
11
|
-
fn: ReturnType<GetEnvelopedFn<any>>['validate'];
|
|
12
|
-
} | {
|
|
13
|
-
phase: 'execute';
|
|
14
|
-
fn: ReturnType<GetEnvelopedFn<any>>['execute'];
|
|
15
|
-
} | {
|
|
16
|
-
phase: 'subscribe';
|
|
17
|
-
fn: ReturnType<GetEnvelopedFn<any>>['subscribe'];
|
|
18
|
-
} | {
|
|
19
|
-
phase: 'contextFactory';
|
|
20
|
-
fn: () => any | Promise<any>;
|
|
21
|
-
};
|
|
22
|
-
export declare function createSpiedPlugin(): {
|
|
23
|
-
reset: () => void;
|
|
24
|
-
spies: {
|
|
25
|
-
beforeParse: import("vitest").Mock<() => import("vitest").Mock<(...args: any[]) => any>>;
|
|
26
|
-
beforeValidate: import("vitest").Mock<() => import("vitest").Mock<(...args: any[]) => any>>;
|
|
27
|
-
beforeContextBuilding: import("vitest").Mock<() => import("vitest").Mock<(...args: any[]) => any>>;
|
|
28
|
-
beforeExecute: import("vitest").Mock<() => {
|
|
29
|
-
onExecuteDone: import("vitest").Mock<(...args: any[]) => any>;
|
|
30
|
-
}>;
|
|
31
|
-
onSchemaChange: import("vitest").Mock<(...args: any[]) => any>;
|
|
32
|
-
afterParse: import("vitest").Mock<(...args: any[]) => any>;
|
|
33
|
-
afterValidate: import("vitest").Mock<(...args: any[]) => any>;
|
|
34
|
-
afterContextBuilding: import("vitest").Mock<(...args: any[]) => any>;
|
|
35
|
-
afterExecute: import("vitest").Mock<(...args: any[]) => any>;
|
|
36
|
-
afterResolver: import("vitest").Mock<(...args: any[]) => any>;
|
|
37
|
-
beforeResolver: import("vitest").Mock<() => import("vitest").Mock<(...args: any[]) => any>>;
|
|
38
|
-
};
|
|
39
|
-
plugin: Plugin;
|
|
40
|
-
};
|
|
41
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
42
|
-
type MaybeAsyncIterableIterator<T> = T | AsyncIterableIterator<T>;
|
|
43
|
-
type ExecutionReturn<TData = any, TExtensions = any> = MaybeAsyncIterableIterator<ExecutionResult<TData, TExtensions>>;
|
|
44
|
-
export type TestkitInstance = {
|
|
45
|
-
execute: (operation: DocumentNode | string, variables?: Record<string, any>, initialContext?: any, operationName?: string) => MaybePromise<ExecutionReturn>;
|
|
46
|
-
modifyPlugins: (modifyPluginsFn: ModifyPluginsFn) => void;
|
|
47
|
-
mockPhase: (phaseReplacement: PhaseReplacementParams) => void;
|
|
48
|
-
wait: (ms: number) => Promise<void>;
|
|
49
|
-
};
|
|
50
|
-
export declare function createTestkit(pluginsOrEnvelop: GetEnvelopedFn<any> | Parameters<typeof envelop>['0']['plugins'], schema?: GraphQLSchema): TestkitInstance;
|
|
51
|
-
export declare function assertSingleExecutionValue<TData = any, TExtensions = any>(input: ExecutionReturn<TData, TExtensions>): asserts input is ExecutionResult<TData, TExtensions>;
|
|
52
|
-
export declare function assertStreamExecutionValue<TData = any, TExtensions = any>(input: ExecutionReturn<TData, TExtensions>): asserts input is AsyncIterableIterator<ExecutionResult<TData, TExtensions>>;
|
|
53
|
-
export declare const collectAsyncIteratorValues: <TType>(asyncIterable: AsyncIterableIterator<TType>) => Promise<TType[]>;
|
|
54
|
-
export {};
|
|
55
|
-
//# sourceMappingURL=envelop-testing.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"envelop-testing.d.ts","sourceRoot":"","sources":["../../../src/plugins/__fixtures__/envelop-testing.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,OAAO,EAKR,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,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