@cedarjs/graphql-server 7.0.0-canary.3180 → 7.0.0-canary.3184
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/{createGraphQLYoga.d.ts → createGraphQLServer.d.ts} +3 -1
- package/dist/createGraphQLServer.d.ts.map +1 -0
- package/dist/{createGraphQLYoga.js → createGraphQLServer.js} +3 -1
- package/dist/functions/graphql.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/plugins/useCedarAuthContext.js +1 -1
- package/package.json +5 -5
- package/dist/createGraphQLYoga.d.ts.map +0 -1
|
@@ -27,6 +27,8 @@ export interface CedarGraphQLServer {
|
|
|
27
27
|
*/
|
|
28
28
|
buildRequestContext: (request: Request) => Promise<CedarRequestContext>;
|
|
29
29
|
}
|
|
30
|
+
export declare const createGraphQLServer: ({ healthCheckId, loggerConfig, context, getCurrentUser, onException, generateGraphiQLHeader, extraPlugins, authDecoder, cors, services, sdls, directives, armorConfig, allowedOperations, allowIntrospection, allowGraphiQL, defaultError, graphiQLEndpoint, schemaOptions, realtime, trustedDocuments, openTelemetryOptions, includeScalars, }: GraphQLYogaOptions) => Promise<CedarGraphQLServer>;
|
|
31
|
+
/** @deprecated Use `createGraphQLServer` instead. */
|
|
30
32
|
export declare const createGraphQLYoga: ({ healthCheckId, loggerConfig, context, getCurrentUser, onException, generateGraphiQLHeader, extraPlugins, authDecoder, cors, services, sdls, directives, armorConfig, allowedOperations, allowIntrospection, allowGraphiQL, defaultError, graphiQLEndpoint, schemaOptions, realtime, trustedDocuments, openTelemetryOptions, includeScalars, }: GraphQLYogaOptions) => Promise<CedarGraphQLServer>;
|
|
31
33
|
export {};
|
|
32
|
-
//# sourceMappingURL=
|
|
34
|
+
//# sourceMappingURL=createGraphQLServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createGraphQLServer.d.ts","sourceRoot":"","sources":["../src/createGraphQLServer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAQ3D,OAAO,KAAK,EAAU,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAyB/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEzE;;;GAGG;AACH,KAAK,sBAAsB,GAAG;IAC5B,GAAG,EAAE,cAAc,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;CACpB,GAAG,mBAAmB,CAAA;AAEvB;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,kBAAkB,CAAC,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAA;IACvE,MAAM,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;CACxE;AAED,eAAO,MAAM,mBAAmB,GAAU,iVAwBvC,kBAAkB,KAAG,OAAO,CAAC,kBAAkB,CAgMjD,CAAA;AAED,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,oVAnM3B,kBAAkB,KAAG,OAAO,CAAC,kBAAkB,CAmME,CAAA"}
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from "./plugins/index.js";
|
|
26
26
|
import { resolveServerAuthState } from "./serverAuthState.js";
|
|
27
27
|
import { makeSubscriptions } from "./subscriptions/makeSubscriptions.js";
|
|
28
|
-
const
|
|
28
|
+
const createGraphQLServer = async ({
|
|
29
29
|
healthCheckId = "yoga",
|
|
30
30
|
loggerConfig,
|
|
31
31
|
context,
|
|
@@ -180,6 +180,8 @@ const createGraphQLYoga = async ({
|
|
|
180
180
|
throw e;
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
+
const createGraphQLYoga = createGraphQLServer;
|
|
183
184
|
export {
|
|
185
|
+
createGraphQLServer,
|
|
184
186
|
createGraphQLYoga
|
|
185
187
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as cookie from "cookie";
|
|
2
2
|
import { getAsyncStoreInstance } from "@cedarjs/context/dist/store";
|
|
3
|
-
import {
|
|
3
|
+
import { createGraphQLServer } from "../createGraphQLServer.js";
|
|
4
4
|
import { resolveServerAuthState } from "../serverAuthState.js";
|
|
5
5
|
function lambdaQueryToSearchParams(event) {
|
|
6
6
|
const query = new URLSearchParams();
|
|
@@ -54,7 +54,7 @@ const createGraphQLHandler = ({
|
|
|
54
54
|
openTelemetryOptions,
|
|
55
55
|
trustedDocuments
|
|
56
56
|
}) => {
|
|
57
|
-
const yogaAndLoggerPromise =
|
|
57
|
+
const yogaAndLoggerPromise = createGraphQLServer({
|
|
58
58
|
healthCheckId,
|
|
59
59
|
loggerConfig,
|
|
60
60
|
context,
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export * from './errors.js';
|
|
|
4
4
|
export * from './functions/graphql.js';
|
|
5
5
|
export * from './functions/useRequireAuth.js';
|
|
6
6
|
export * from './makeMergedSchema.js';
|
|
7
|
-
export * from './
|
|
7
|
+
export * from './createGraphQLServer.js';
|
|
8
8
|
export * from './types.js';
|
|
9
9
|
export { createValidatorDirective, createTransformerDirective, getDirectiveName, makeDirectivesForPlugin, } from './directives/makeDirectives.js';
|
|
10
10
|
export { hasDirective, DirectiveType, useCedarDirective, useRedwoodDirective, } from './plugins/useRedwoodDirective.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAA;AAErC,cAAc,8BAA8B,CAAA;AAE5C,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAA;AAErC,cAAc,8BAA8B,CAAA;AAE5C,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,YAAY,CAAA;AAE1B,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EACL,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,kCAAkC,CAAA;AAEzC,YAAY,EACV,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,YAAY,EACZ,aAAa,GACd,MAAM,kCAAkC,CAAA;AAEzC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAG7C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export * from "./errors.js";
|
|
|
4
4
|
export * from "./functions/graphql.js";
|
|
5
5
|
export * from "./functions/useRequireAuth.js";
|
|
6
6
|
export * from "./makeMergedSchema.js";
|
|
7
|
-
export * from "./
|
|
7
|
+
export * from "./createGraphQLServer.js";
|
|
8
8
|
export * from "./types.js";
|
|
9
9
|
import {
|
|
10
10
|
createValidatorDirective,
|
|
@@ -3,7 +3,7 @@ const useCedarAuthContext = (getCurrentUser) => {
|
|
|
3
3
|
async onContextBuilding({ context, extendContext }) {
|
|
4
4
|
if (!context.cedarContext && getCurrentUser) {
|
|
5
5
|
throw new Error(
|
|
6
|
-
"Auth state is resolved when a request enters Cedar and passed on the GraphQL context, but this context has no `cedarContext`. Whatever is invoking `yoga.handle` needs to build one with the `buildRequestContext` returned by `
|
|
6
|
+
"Auth state is resolved when a request enters Cedar and passed on the GraphQL context, but this context has no `cedarContext`. Whatever is invoking `yoga.handle` needs to build one with the `buildRequestContext` returned by `createGraphQLServer` and pass it as `cedarContext`."
|
|
7
7
|
);
|
|
8
8
|
}
|
|
9
9
|
const authContext = context.cedarContext?.serverAuthState;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/graphql-server",
|
|
3
|
-
"version": "7.0.0-canary.
|
|
3
|
+
"version": "7.0.0-canary.3184",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"test:watch": "yarn test --watch"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@cedarjs/api": "7.0.0-canary.
|
|
36
|
-
"@cedarjs/context": "7.0.0-canary.
|
|
35
|
+
"@cedarjs/api": "7.0.0-canary.3184",
|
|
36
|
+
"@cedarjs/context": "7.0.0-canary.3184",
|
|
37
37
|
"@envelop/core": "5.6.0",
|
|
38
38
|
"@envelop/disable-introspection": "6.0.0",
|
|
39
39
|
"@envelop/filter-operation-type": "6.0.0",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"uuid": "11.1.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@cedarjs/framework-tools": "7.0.0-canary.
|
|
57
|
-
"@cedarjs/realtime": "7.0.0-canary.
|
|
56
|
+
"@cedarjs/framework-tools": "7.0.0-canary.3184",
|
|
57
|
+
"@cedarjs/realtime": "7.0.0-canary.3184",
|
|
58
58
|
"@envelop/types": "5.2.1",
|
|
59
59
|
"@escape.tech/graphql-armor-types": "0.7.0",
|
|
60
60
|
"@types/aws-lambda": "8.10.163",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createGraphQLYoga.d.ts","sourceRoot":"","sources":["../src/createGraphQLYoga.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAQ3D,OAAO,KAAK,EAAU,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAyB/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEzE;;;GAGG;AACH,KAAK,sBAAsB,GAAG;IAC5B,GAAG,EAAE,cAAc,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;CACpB,GAAG,mBAAmB,CAAA;AAEvB;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,kBAAkB,CAAC,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAA;IACvE,MAAM,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAA;CACxE;AAED,eAAO,MAAM,iBAAiB,GAAU,iVAwBrC,kBAAkB,KAAG,OAAO,CAAC,kBAAkB,CAgMjD,CAAA"}
|