joist-graphql-resolver-utils 2.5.0-next.8 → 2.5.0-next.9
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/build/context.d.cts +0 -2
- package/build/context.d.cts.map +1 -1
- package/build/context.d.mts +0 -2
- package/build/context.d.mts.map +1 -1
- package/build/cursorPagination.cjs +1 -2
- package/build/cursorPagination.d.cts +0 -2
- package/build/cursorPagination.d.cts.map +1 -1
- package/build/cursorPagination.d.mts +0 -2
- package/build/cursorPagination.d.mts.map +1 -1
- package/build/cursorPagination.js +1 -2
- package/build/entityResolver.cjs +1 -2
- package/build/entityResolver.d.cts +0 -2
- package/build/entityResolver.d.cts.map +1 -1
- package/build/entityResolver.d.mts +0 -2
- package/build/entityResolver.d.mts.map +1 -1
- package/build/entityResolver.js +1 -2
- package/build/hint.cjs +1 -2
- package/build/hint.d.cts +0 -2
- package/build/hint.d.cts.map +1 -1
- package/build/hint.d.mts +0 -2
- package/build/hint.d.mts.map +1 -1
- package/build/hint.js +1 -2
- package/build/index.cjs +1 -1
- package/build/index.js +1 -1
- package/build/limitPagination.cjs +1 -2
- package/build/limitPagination.d.cts +0 -2
- package/build/limitPagination.d.cts.map +1 -1
- package/build/limitPagination.d.mts +0 -2
- package/build/limitPagination.d.mts.map +1 -1
- package/build/limitPagination.js +1 -2
- package/build/makeRunInputMutation.cjs +1 -2
- package/build/makeRunInputMutation.d.cts +0 -2
- package/build/makeRunInputMutation.d.cts.map +1 -1
- package/build/makeRunInputMutation.d.mts +0 -2
- package/build/makeRunInputMutation.d.mts.map +1 -1
- package/build/makeRunInputMutation.js +1 -2
- package/build/makeRunObjectField.cjs +1 -2
- package/build/makeRunObjectField.d.cts +0 -2
- package/build/makeRunObjectField.d.cts.map +1 -1
- package/build/makeRunObjectField.d.mts +0 -2
- package/build/makeRunObjectField.d.mts.map +1 -1
- package/build/makeRunObjectField.js +1 -2
- package/build/makeRunObjectFields.cjs +1 -2
- package/build/makeRunObjectFields.d.cts +0 -2
- package/build/makeRunObjectFields.d.cts.map +1 -1
- package/build/makeRunObjectFields.d.mts +0 -2
- package/build/makeRunObjectFields.d.mts.map +1 -1
- package/build/makeRunObjectFields.js +1 -2
- package/build/makeRunQuery.cjs +1 -2
- package/build/makeRunQuery.d.cts +0 -2
- package/build/makeRunQuery.d.cts.map +1 -1
- package/build/makeRunQuery.d.mts +0 -2
- package/build/makeRunQuery.d.mts.map +1 -1
- package/build/makeRunQuery.js +1 -2
- package/build/paginationUtils.cjs +1 -2
- package/build/paginationUtils.d.cts +0 -2
- package/build/paginationUtils.d.cts.map +1 -1
- package/build/paginationUtils.d.mts +0 -2
- package/build/paginationUtils.d.mts.map +1 -1
- package/build/paginationUtils.js +1 -2
- package/build/saveEntity.cjs +1 -2
- package/build/saveEntity.d.cts +0 -2
- package/build/saveEntity.d.cts.map +1 -1
- package/build/saveEntity.d.mts +0 -2
- package/build/saveEntity.d.mts.map +1 -1
- package/build/saveEntity.js +1 -2
- package/build/tests.d.cts +1 -1
- package/build/tests.d.mts +1 -1
- package/build/typeUtils.d.cts +0 -2
- package/build/typeUtils.d.cts.map +1 -1
- package/build/typeUtils.d.mts +0 -2
- package/build/typeUtils.d.mts.map +1 -1
- package/package.json +5 -5
package/build/context.d.cts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { GraphQLResolveInfo } from "graphql/type";
|
|
2
|
-
//#region src/context.d.ts
|
|
3
2
|
export type MaybePromise<T> = T | Promise<T>;
|
|
4
3
|
export type Resolver<R, A, T> = (root: R, args: A, ctx: any, info: GraphQLResolveInfo) => MaybePromise<T>;
|
|
5
|
-
//#endregion
|
|
6
4
|
//# sourceMappingURL=context.d.cts.map
|
package/build/context.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.cts","names":[],"sources":["../src/context.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.cts","names":[],"sources":["../src/context.ts"],"mappings":";YAEY,aAAa,KAAK,IAAI,QAAQ;YAG9B,SAAS,GAAG,GAAG,MAAM,MAAM,GAAG,MAAM,GAAG,UAAU,MAAM,uBAAuB,aAAa"}
|
package/build/context.d.mts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { GraphQLResolveInfo } from "graphql/type";
|
|
2
|
-
//#region src/context.d.ts
|
|
3
2
|
export type MaybePromise<T> = T | Promise<T>;
|
|
4
3
|
export type Resolver<R, A, T> = (root: R, args: A, ctx: any, info: GraphQLResolveInfo) => MaybePromise<T>;
|
|
5
|
-
//#endregion
|
|
6
4
|
//# sourceMappingURL=context.d.mts.map
|
package/build/context.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.mts","names":[],"sources":["../src/context.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.mts","names":[],"sources":["../src/context.ts"],"mappings":";YAEY,aAAa,KAAK,IAAI,QAAQ;YAG9B,SAAS,GAAG,GAAG,MAAM,MAAM,GAAG,MAAM,GAAG,UAAU,MAAM,uBAAuB,aAAa"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_paginationUtils = require("./paginationUtils.cjs");
|
|
3
3
|
require("joist-core");
|
|
4
|
-
|
|
4
|
+
// src/cursorPagination.ts
|
|
5
5
|
async function paginateCursor(ctx, type, args) {
|
|
6
6
|
const limit = args.first ?? args.last ?? 100;
|
|
7
7
|
const baseFilter = args.filter ?? {};
|
|
@@ -103,7 +103,6 @@ function encodeCursor(id) {
|
|
|
103
103
|
function decodeCursor(cursor) {
|
|
104
104
|
return Buffer.from(cursor, "base64").toString("utf8");
|
|
105
105
|
}
|
|
106
|
-
//#endregion
|
|
107
106
|
exports.CursorPageInfo = CursorPageInfo;
|
|
108
107
|
exports.paginateCursor = paginateCursor;
|
|
109
108
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ContextWithEm, PaginationFilter, PaginationQuery } from "./paginationUtils.cjs";
|
|
2
2
|
import { Entity, MaybeAbstractEntityConstructor } from "joist-core";
|
|
3
|
-
//#region src/cursorPagination.d.ts
|
|
4
3
|
type CursorArgs<T extends Entity, F extends object = PaginationFilter<T>> = {
|
|
5
4
|
filter?: F | null;
|
|
6
5
|
first?: number | null;
|
|
@@ -38,6 +37,5 @@ export declare class CursorPageInfo<T extends Entity = Entity> {
|
|
|
38
37
|
get hasPreviousPage(): Promise<boolean>;
|
|
39
38
|
get totalCount(): Promise<number>;
|
|
40
39
|
}
|
|
41
|
-
//#endregion
|
|
42
40
|
export {};
|
|
43
41
|
//# sourceMappingURL=cursorPagination.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursorPagination.d.cts","names":[],"sources":["../src/cursorPagination.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"cursorPagination.d.cts","names":[],"sources":["../src/cursorPagination.ts"],"mappings":";;KAkBK,WAAW,UAAU,QAAQ,mBAAmB,iBAAiB;EACpE,SAAS;EACT;EACA;EACA;EACA;;;wBAIc,eAAe,UAAU,QACvC,KAAK,eACL,OAAO,gBAAgB,IACvB,MAAM,KAAK,WAAW,gBACrB;EAAU;IAAS,MAAM;IAAG;;EAAoB,OAAO;EAAK,UAAU,eAAe;;wBACxE,eAAe,UAAU,QAAQ,mBAAmB,iBAAiB,IACnF,KAAK,eACL,MAAM,+BAA+B,IACrC,MAAM,WAAW,GAAG,KACnB;EAAU;IAAS,MAAM;IAAG;;EAAoB,OAAO;EAAK,UAAU,eAAe;;;qBAkC3E,eAAe,UAAU,SAAS;;EAS7C,YACE,KAAK,eACL,MAAM,+BAA+B,KAAK,gBAAgB,IAC1D,QAAQ,iBAAiB,IACzB;IAAS,MAAM;IAAG;;MAQhB;MAIA;MAIA,eAAe;MAIf,mBAAmB;MAInB,cAAc"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ContextWithEm, PaginationFilter, PaginationQuery } from "./paginationUtils.mjs";
|
|
2
2
|
import { Entity, MaybeAbstractEntityConstructor } from "joist-core";
|
|
3
|
-
//#region src/cursorPagination.d.ts
|
|
4
3
|
type CursorArgs<T extends Entity, F extends object = PaginationFilter<T>> = {
|
|
5
4
|
filter?: F | null;
|
|
6
5
|
first?: number | null;
|
|
@@ -38,6 +37,5 @@ export declare class CursorPageInfo<T extends Entity = Entity> {
|
|
|
38
37
|
get hasPreviousPage(): Promise<boolean>;
|
|
39
38
|
get totalCount(): Promise<number>;
|
|
40
39
|
}
|
|
41
|
-
//#endregion
|
|
42
40
|
export {};
|
|
43
41
|
//# sourceMappingURL=cursorPagination.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursorPagination.d.mts","names":[],"sources":["../src/cursorPagination.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"cursorPagination.d.mts","names":[],"sources":["../src/cursorPagination.ts"],"mappings":";;KAkBK,WAAW,UAAU,QAAQ,mBAAmB,iBAAiB;EACpE,SAAS;EACT;EACA;EACA;EACA;;;wBAIc,eAAe,UAAU,QACvC,KAAK,eACL,OAAO,gBAAgB,IACvB,MAAM,KAAK,WAAW,gBACrB;EAAU;IAAS,MAAM;IAAG;;EAAoB,OAAO;EAAK,UAAU,eAAe;;wBACxE,eAAe,UAAU,QAAQ,mBAAmB,iBAAiB,IACnF,KAAK,eACL,MAAM,+BAA+B,IACrC,MAAM,WAAW,GAAG,KACnB;EAAU;IAAS,MAAM;IAAG;;EAAoB,OAAO;EAAK,UAAU,eAAe;;;qBAkC3E,eAAe,UAAU,SAAS;;EAS7C,YACE,KAAK,eACL,MAAM,+BAA+B,KAAK,gBAAgB,IAC1D,QAAQ,iBAAiB,IACzB;IAAS,MAAM;IAAG;;MAQhB;MAIA;MAIA,eAAe;MAIf,mBAAmB;MAInB,cAAc"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { countQuery, queryEntities } from "./paginationUtils.js";
|
|
2
2
|
import "joist-core";
|
|
3
|
-
|
|
3
|
+
// src/cursorPagination.ts
|
|
4
4
|
async function paginateCursor(ctx, type, args) {
|
|
5
5
|
const limit = args.first ?? args.last ?? 100;
|
|
6
6
|
const baseFilter = args.filter ?? {};
|
|
@@ -102,7 +102,6 @@ function encodeCursor(id) {
|
|
|
102
102
|
function decodeCursor(cursor) {
|
|
103
103
|
return Buffer.from(cursor, "base64").toString("utf8");
|
|
104
104
|
}
|
|
105
|
-
//#endregion
|
|
106
105
|
export { CursorPageInfo, paginateCursor };
|
|
107
106
|
|
|
108
107
|
//# sourceMappingURL=cursorPagination.js.map
|
package/build/entityResolver.cjs
CHANGED
|
@@ -3,7 +3,7 @@ require("./context.cjs");
|
|
|
3
3
|
const require_hint = require("./hint.cjs");
|
|
4
4
|
require("graphql/type");
|
|
5
5
|
let joist_core = require("joist-core");
|
|
6
|
-
|
|
6
|
+
// src/entityResolver.ts
|
|
7
7
|
/**
|
|
8
8
|
* Creates field resolvers for each of the fields on our entity.
|
|
9
9
|
*/
|
|
@@ -89,7 +89,6 @@ function isCollectionField(ormField) {
|
|
|
89
89
|
function isPrimaryKeyField(ormField) {
|
|
90
90
|
return ormField.kind === "primaryKey";
|
|
91
91
|
}
|
|
92
|
-
//#endregion
|
|
93
92
|
exports.entityResolver = entityResolver;
|
|
94
93
|
|
|
95
94
|
//# sourceMappingURL=entityResolver.cjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Resolver } from "./context.cjs";
|
|
2
2
|
import { Collection, Entity, EntityMetadata, IdOf, MaybeAbstractEntityConstructor, Property, ReactiveGetter, ReadOnlyCollection, Reference } from "joist-core";
|
|
3
|
-
//#region src/entityResolver.d.ts
|
|
4
3
|
type GraphQLPrimitive = string | Date | boolean | number | bigint | null | undefined;
|
|
5
4
|
/**
|
|
6
5
|
* Maps properties like `Entity.firstName: string` to field resolver functions like `firstName(): Promise<string>`.
|
|
@@ -18,6 +17,5 @@ export type EntityResolver<T extends Entity> = { [P in keyof T]: P extends "id"
|
|
|
18
17
|
* Creates field resolvers for each of the fields on our entity.
|
|
19
18
|
*/
|
|
20
19
|
export declare function entityResolver<T extends Entity, A extends Record<string, keyof T> = {}>(entity: MaybeAbstractEntityConstructor<T> | EntityMetadata<T>, aliases?: A): EntityResolver<T> & { [K in keyof A]: EntityResolver<T>[A[K]]; };
|
|
21
|
-
//#endregion
|
|
22
20
|
export {};
|
|
23
21
|
//# sourceMappingURL=entityResolver.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityResolver.d.cts","names":[],"sources":["../src/entityResolver.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"entityResolver.d.cts","names":[],"sources":["../src/entityResolver.ts"],"mappings":";;KAwCK,4BAA4B;;;;;;;;;;;;YAarB,eAAe,UAAU,aAClC,WAAW,IAAI,iBACZ,SAAS,GAAG,qBAAqB,KAAK,MACtC,EAAE,WAAW,mBAAmB,qBAC9B,SAAS,GAAG,qBAAqB,EAAE,MACnC,EAAE,WAAW,sBAAsB,KACjC,SAAS,GAAG,qBAAqB,OACjC,EAAE,WAAW,8BAA8B,KACzC,SAAS,GAAG,qBAAqB,OACjC,EAAE,WAAW,qBAAqB,SAAS,KACzC,SAAS,GAAG,qBAAqB,IAAI,KACrC,EAAE,WAAW,oBAAoB,KAC/B,SAAS,GAAG,qBAAqB,KACjC,EAAE,WAAW,0BAA0B,KACrC,SAAS,GAAG,qBAAqB,KACjC,EAAE,WAAW,cAAc,KACzB,SAAS,GAAG,qBAAqB,KACjC,EAAE,kBAAiB,cAAc,MAC/B,SAAS,GAAG,qBAAqB,KACjC,EAAE,wBAAuB,KACvB,SAAS,GAAG,qBAAqB,KACjC,SAAS,GAAG,qBAAqB,EAAE;;;;wBAM3C,eAAe,UAAU,QAAQ,UAAU,qBAAqB,SAC9E,QAAQ,+BAA+B,KAAK,eAAe,IAC3D,UAAU,IACT,eAAe,QAAQ,WAAW,IAAI,eAAe,GAAG,EAAE"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Resolver } from "./context.mjs";
|
|
2
2
|
import { Collection, Entity, EntityMetadata, IdOf, MaybeAbstractEntityConstructor, Property, ReactiveGetter, ReadOnlyCollection, Reference } from "joist-core";
|
|
3
|
-
//#region src/entityResolver.d.ts
|
|
4
3
|
type GraphQLPrimitive = string | Date | boolean | number | bigint | null | undefined;
|
|
5
4
|
/**
|
|
6
5
|
* Maps properties like `Entity.firstName: string` to field resolver functions like `firstName(): Promise<string>`.
|
|
@@ -18,6 +17,5 @@ export type EntityResolver<T extends Entity> = { [P in keyof T]: P extends "id"
|
|
|
18
17
|
* Creates field resolvers for each of the fields on our entity.
|
|
19
18
|
*/
|
|
20
19
|
export declare function entityResolver<T extends Entity, A extends Record<string, keyof T> = {}>(entity: MaybeAbstractEntityConstructor<T> | EntityMetadata<T>, aliases?: A): EntityResolver<T> & { [K in keyof A]: EntityResolver<T>[A[K]]; };
|
|
21
|
-
//#endregion
|
|
22
20
|
export {};
|
|
23
21
|
//# sourceMappingURL=entityResolver.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityResolver.d.mts","names":[],"sources":["../src/entityResolver.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"entityResolver.d.mts","names":[],"sources":["../src/entityResolver.ts"],"mappings":";;KAwCK,4BAA4B;;;;;;;;;;;;YAarB,eAAe,UAAU,aAClC,WAAW,IAAI,iBACZ,SAAS,GAAG,qBAAqB,KAAK,MACtC,EAAE,WAAW,mBAAmB,qBAC9B,SAAS,GAAG,qBAAqB,EAAE,MACnC,EAAE,WAAW,sBAAsB,KACjC,SAAS,GAAG,qBAAqB,OACjC,EAAE,WAAW,8BAA8B,KACzC,SAAS,GAAG,qBAAqB,OACjC,EAAE,WAAW,qBAAqB,SAAS,KACzC,SAAS,GAAG,qBAAqB,IAAI,KACrC,EAAE,WAAW,oBAAoB,KAC/B,SAAS,GAAG,qBAAqB,KACjC,EAAE,WAAW,0BAA0B,KACrC,SAAS,GAAG,qBAAqB,KACjC,EAAE,WAAW,cAAc,KACzB,SAAS,GAAG,qBAAqB,KACjC,EAAE,kBAAiB,cAAc,MAC/B,SAAS,GAAG,qBAAqB,KACjC,EAAE,wBAAuB,KACvB,SAAS,GAAG,qBAAqB,KACjC,SAAS,GAAG,qBAAqB,EAAE;;;;wBAM3C,eAAe,UAAU,QAAQ,UAAU,qBAAqB,SAC9E,QAAQ,+BAA+B,KAAK,eAAe,IAC3D,UAAU,IACT,eAAe,QAAQ,WAAW,IAAI,eAAe,GAAG,EAAE"}
|
package/build/entityResolver.js
CHANGED
|
@@ -2,7 +2,7 @@ import "./context.js";
|
|
|
2
2
|
import { convertInfoToLoadHint } from "./hint.js";
|
|
3
3
|
import "graphql/type";
|
|
4
4
|
import { getMetadata, getProperties, isAsyncProperty, isCollection, isLoadedAsyncProperty, isLoadedCollection, isLoadedLazyField, isLoadedProperty, isLoadedReadOnlyCollection, isLoadedReference, isManyToOneField, isOneToManyField, isProperty, isReactiveGetter, isReadOnlyCollection, isReference } from "joist-core";
|
|
5
|
-
|
|
5
|
+
// src/entityResolver.ts
|
|
6
6
|
/**
|
|
7
7
|
* Creates field resolvers for each of the fields on our entity.
|
|
8
8
|
*/
|
|
@@ -88,7 +88,6 @@ function isCollectionField(ormField) {
|
|
|
88
88
|
function isPrimaryKeyField(ormField) {
|
|
89
89
|
return ormField.kind === "primaryKey";
|
|
90
90
|
}
|
|
91
|
-
//#endregion
|
|
92
91
|
export { entityResolver };
|
|
93
92
|
|
|
94
93
|
//# sourceMappingURL=entityResolver.js.map
|
package/build/hint.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
let graphql_type = require("graphql/type");
|
|
3
3
|
require("joist-core");
|
|
4
4
|
require("graphql/language");
|
|
5
|
-
|
|
5
|
+
// src/hint.ts
|
|
6
6
|
/** Returns a load hint for the given `meta` entity at the `info` node.populate`. */
|
|
7
7
|
function convertInfoToLoadHint(meta, info) {
|
|
8
8
|
const objectType = convertToObjectType(info.returnType);
|
|
@@ -42,7 +42,6 @@ function convertToObjectType(type) {
|
|
|
42
42
|
function deepMerge(a, b) {
|
|
43
43
|
for (const [key, value] of Object.entries(b)) deepMerge(a[key] ??= {}, value);
|
|
44
44
|
}
|
|
45
|
-
//#endregion
|
|
46
45
|
exports.convertInfoToLoadHint = convertInfoToLoadHint;
|
|
47
46
|
exports.convertToObjectType = convertToObjectType;
|
|
48
47
|
exports.selectionSetToObject = selectionSetToObject;
|
package/build/hint.d.cts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { GraphQLObjectType, GraphQLOutputType, GraphQLResolveInfo } from "graphql/type";
|
|
2
2
|
import { Entity, EntityMetadata, LoadHint } from "joist-core";
|
|
3
3
|
import { SelectionSetNode } from "graphql/language";
|
|
4
|
-
//#region src/hint.d.ts
|
|
5
4
|
/** Returns a load hint for the given `meta` entity at the `info` node.populate`. */
|
|
6
5
|
export declare function convertInfoToLoadHint<T extends Entity>(meta: EntityMetadata, info: GraphQLResolveInfo): LoadHint<T> | undefined;
|
|
7
6
|
/** Converts a GraphQL selection set into a hint for `EntityManager.populate`. */
|
|
8
7
|
export declare function selectionSetToObject(info: GraphQLResolveInfo, meta: EntityMetadata, gqlType: GraphQLObjectType, selectionSet: SelectionSetNode): Record<string, any>;
|
|
9
8
|
export declare function convertToObjectType(type: GraphQLOutputType): GraphQLObjectType | undefined;
|
|
10
|
-
//#endregion
|
|
11
9
|
//# sourceMappingURL=hint.d.cts.map
|
package/build/hint.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hint.d.cts","names":[],"sources":["../src/hint.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"hint.d.cts","names":[],"sources":["../src/hint.ts"],"mappings":";;;;wBAYgB,sBAAsB,UAAU,QAC9C,MAAM,gBACN,MAAM,qBACL,SAAS;;wBAgBI,qBACd,MAAM,oBACN,MAAM,gBACN,SAAS,mBACT,cAAc,mBACb;wBAoCa,oBAAoB,MAAM,oBAAoB"}
|
package/build/hint.d.mts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { GraphQLObjectType, GraphQLOutputType, GraphQLResolveInfo } from "graphql/type";
|
|
2
2
|
import { Entity, EntityMetadata, LoadHint } from "joist-core";
|
|
3
3
|
import { SelectionSetNode } from "graphql/language";
|
|
4
|
-
//#region src/hint.d.ts
|
|
5
4
|
/** Returns a load hint for the given `meta` entity at the `info` node.populate`. */
|
|
6
5
|
export declare function convertInfoToLoadHint<T extends Entity>(meta: EntityMetadata, info: GraphQLResolveInfo): LoadHint<T> | undefined;
|
|
7
6
|
/** Converts a GraphQL selection set into a hint for `EntityManager.populate`. */
|
|
8
7
|
export declare function selectionSetToObject(info: GraphQLResolveInfo, meta: EntityMetadata, gqlType: GraphQLObjectType, selectionSet: SelectionSetNode): Record<string, any>;
|
|
9
8
|
export declare function convertToObjectType(type: GraphQLOutputType): GraphQLObjectType | undefined;
|
|
10
|
-
//#endregion
|
|
11
9
|
//# sourceMappingURL=hint.d.mts.map
|
package/build/hint.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hint.d.mts","names":[],"sources":["../src/hint.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"hint.d.mts","names":[],"sources":["../src/hint.ts"],"mappings":";;;;wBAYgB,sBAAsB,UAAU,QAC9C,MAAM,gBACN,MAAM,qBACL,SAAS;;wBAgBI,qBACd,MAAM,oBACN,MAAM,gBACN,SAAS,mBACT,cAAc,mBACb;wBAoCa,oBAAoB,MAAM,oBAAoB"}
|
package/build/hint.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GraphQLList, GraphQLNonNull, isObjectType } from "graphql/type";
|
|
2
2
|
import "joist-core";
|
|
3
3
|
import "graphql/language";
|
|
4
|
-
|
|
4
|
+
// src/hint.ts
|
|
5
5
|
/** Returns a load hint for the given `meta` entity at the `info` node.populate`. */
|
|
6
6
|
function convertInfoToLoadHint(meta, info) {
|
|
7
7
|
const objectType = convertToObjectType(info.returnType);
|
|
@@ -41,7 +41,6 @@ function convertToObjectType(type) {
|
|
|
41
41
|
function deepMerge(a, b) {
|
|
42
42
|
for (const [key, value] of Object.entries(b)) deepMerge(a[key] ??= {}, value);
|
|
43
43
|
}
|
|
44
|
-
//#endregion
|
|
45
44
|
export { convertInfoToLoadHint, convertToObjectType, selectionSetToObject };
|
|
46
45
|
|
|
47
46
|
//# sourceMappingURL=hint.js.map
|
package/build/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_cursorPagination = require("./cursorPagination.cjs");
|
|
3
|
-
const require_hint = require("./hint.cjs");
|
|
4
3
|
const require_entityResolver = require("./entityResolver.cjs");
|
|
4
|
+
const require_hint = require("./hint.cjs");
|
|
5
5
|
const require_limitPagination = require("./limitPagination.cjs");
|
|
6
6
|
const require_saveEntity = require("./saveEntity.cjs");
|
|
7
7
|
exports.CursorPageInfo = require_cursorPagination.CursorPageInfo;
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CursorPageInfo, paginateCursor } from "./cursorPagination.js";
|
|
2
|
-
import { convertInfoToLoadHint } from "./hint.js";
|
|
3
2
|
import { entityResolver } from "./entityResolver.js";
|
|
3
|
+
import { convertInfoToLoadHint } from "./hint.js";
|
|
4
4
|
import { LimitPageInfo, paginateLimit } from "./limitPagination.js";
|
|
5
5
|
import { saveEntities, saveEntity } from "./saveEntity.js";
|
|
6
6
|
export { CursorPageInfo, LimitPageInfo, convertInfoToLoadHint, entityResolver, paginateCursor, paginateLimit, saveEntities, saveEntity };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_paginationUtils = require("./paginationUtils.cjs");
|
|
3
3
|
require("joist-core");
|
|
4
|
-
|
|
4
|
+
// src/limitPagination.ts
|
|
5
5
|
async function paginateLimit(ctx, type, args) {
|
|
6
6
|
const limit = args.limit ?? 100;
|
|
7
7
|
const offset = args.offset ?? 0;
|
|
@@ -61,7 +61,6 @@ var LimitPageInfo = class {
|
|
|
61
61
|
return this.currentPage + 1;
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
//#endregion
|
|
65
64
|
exports.LimitPageInfo = LimitPageInfo;
|
|
66
65
|
exports.paginateLimit = paginateLimit;
|
|
67
66
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ContextWithEm, PaginationFilter, PaginationQuery } from "./paginationUtils.cjs";
|
|
2
2
|
import { Entity, MaybeAbstractEntityConstructor } from "joist-core";
|
|
3
|
-
//#region src/limitPagination.d.ts
|
|
4
3
|
type LimitArgs<T extends Entity, F extends object = PaginationFilter<T>> = {
|
|
5
4
|
filter?: F | null;
|
|
6
5
|
limit?: number | null;
|
|
@@ -29,6 +28,5 @@ export declare class LimitPageInfo<T extends Entity = Entity> {
|
|
|
29
28
|
get nextPage(): Promise<number | undefined>;
|
|
30
29
|
get currentPage(): number;
|
|
31
30
|
}
|
|
32
|
-
//#endregion
|
|
33
31
|
export {};
|
|
34
32
|
//# sourceMappingURL=limitPagination.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limitPagination.d.cts","names":[],"sources":["../src/limitPagination.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"limitPagination.d.cts","names":[],"sources":["../src/limitPagination.ts"],"mappings":";;KAWK,UAAU,UAAU,QAAQ,mBAAmB,iBAAiB;EACnE,SAAS;EACT;EACA;;KAEG;EAAS;EAAgB;;;wBAGd,cAAc,UAAU,QACtC,KAAK,eACL,OAAO,gBAAgB,IACvB,MAAM,KAAK,UAAU,gBACpB;EAAU,UAAU;EAAK,UAAU,cAAc;;wBACpC,cAAc,UAAU,QAAQ,mBAAmB,iBAAiB,IAClF,KAAK,eACL,MAAM,+BAA+B,IACrC,MAAM,UAAU,GAAG,KAClB;EAAU,UAAU;EAAK,UAAU,cAAc;;;qBAiBvC,cAAc,UAAU,SAAS;;EAO5C,YACE,KAAK,eACL,MAAM,+BAA+B,KAAK,gBAAgB,IAC1D,QAAQ,iBAAiB,IACzB,MAAM;MAQJ,eAAe;MAIf;MAIA,cAAc;MAOd,YAAY;MAIZ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ContextWithEm, PaginationFilter, PaginationQuery } from "./paginationUtils.mjs";
|
|
2
2
|
import { Entity, MaybeAbstractEntityConstructor } from "joist-core";
|
|
3
|
-
//#region src/limitPagination.d.ts
|
|
4
3
|
type LimitArgs<T extends Entity, F extends object = PaginationFilter<T>> = {
|
|
5
4
|
filter?: F | null;
|
|
6
5
|
limit?: number | null;
|
|
@@ -29,6 +28,5 @@ export declare class LimitPageInfo<T extends Entity = Entity> {
|
|
|
29
28
|
get nextPage(): Promise<number | undefined>;
|
|
30
29
|
get currentPage(): number;
|
|
31
30
|
}
|
|
32
|
-
//#endregion
|
|
33
31
|
export {};
|
|
34
32
|
//# sourceMappingURL=limitPagination.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limitPagination.d.mts","names":[],"sources":["../src/limitPagination.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"limitPagination.d.mts","names":[],"sources":["../src/limitPagination.ts"],"mappings":";;KAWK,UAAU,UAAU,QAAQ,mBAAmB,iBAAiB;EACnE,SAAS;EACT;EACA;;KAEG;EAAS;EAAgB;;;wBAGd,cAAc,UAAU,QACtC,KAAK,eACL,OAAO,gBAAgB,IACvB,MAAM,KAAK,UAAU,gBACpB;EAAU,UAAU;EAAK,UAAU,cAAc;;wBACpC,cAAc,UAAU,QAAQ,mBAAmB,iBAAiB,IAClF,KAAK,eACL,MAAM,+BAA+B,IACrC,MAAM,UAAU,GAAG,KAClB;EAAU,UAAU;EAAK,UAAU,cAAc;;;qBAiBvC,cAAc,UAAU,SAAS;;EAO5C,YACE,KAAK,eACL,MAAM,+BAA+B,KAAK,gBAAgB,IAC1D,QAAQ,iBAAiB,IACzB,MAAM;MAQJ,eAAe;MAIf;MAIA,cAAc;MAOd,YAAY;MAIZ"}
|
package/build/limitPagination.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { countQuery, queryEntities } from "./paginationUtils.js";
|
|
2
2
|
import "joist-core";
|
|
3
|
-
|
|
3
|
+
// src/limitPagination.ts
|
|
4
4
|
async function paginateLimit(ctx, type, args) {
|
|
5
5
|
const limit = args.limit ?? 100;
|
|
6
6
|
const offset = args.offset ?? 0;
|
|
@@ -60,7 +60,6 @@ var LimitPageInfo = class {
|
|
|
60
60
|
return this.currentPage + 1;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
//#endregion
|
|
64
63
|
export { LimitPageInfo, paginateLimit };
|
|
65
64
|
|
|
66
65
|
//# sourceMappingURL=limitPagination.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./context.cjs");
|
|
3
3
|
require("./typeUtils.cjs");
|
|
4
|
-
|
|
4
|
+
// src/makeRunInputMutation.ts
|
|
5
5
|
/**
|
|
6
6
|
* Creates a `makeRunInputMutation` function for each project's `testUtils` file.
|
|
7
7
|
*
|
|
@@ -15,7 +15,6 @@ function makeMakeRunInputMutation(runFn) {
|
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
exports.makeMakeRunInputMutation = makeMakeRunInputMutation;
|
|
20
19
|
|
|
21
20
|
//# sourceMappingURL=makeRunInputMutation.cjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Resolver } from "./context.cjs";
|
|
2
2
|
import { ResolverResult, RunFn } from "./typeUtils.cjs";
|
|
3
|
-
//#region src/makeRunInputMutation.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Creates a `makeRunInputMutation` function for each project's `testUtils` file.
|
|
6
5
|
*
|
|
@@ -19,6 +18,5 @@ type RunInputMutationMethod<C, T> = <I extends MutationInput<T>, R = ResolverRes
|
|
|
19
18
|
type MutationInput<T> = T[keyof T] extends Resolver<any, {
|
|
20
19
|
input: infer I;
|
|
21
20
|
}, any> ? I : never;
|
|
22
|
-
//#endregion
|
|
23
21
|
export {};
|
|
24
22
|
//# sourceMappingURL=makeRunInputMutation.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeRunInputMutation.d.cts","names":[],"sources":["../src/makeRunInputMutation.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"makeRunInputMutation.d.cts","names":[],"sources":["../src/makeRunInputMutation.ts"],"mappings":";;;;;;;;wBASgB,yBAAyB,GAAG,OAAO,MAAM,KAAK,qBAAqB;;;;;;YAoBvE,qBAAqB,MAAM,kBAAkB,UAAU,MAAM,uBAAuB,GAAG;KAE9F,uBAAuB,GAAG,MAAM,UAAU,cAAc,IAAI,IAAI,eAAe,SAAS,IAC3F,KAAK,GACL,OAAO,WAAW,OACf,QAAQ;;KAGR,cAAc,KAAK,QAAQ,WAAW;EAAgB,aAAa;UAAY"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Resolver } from "./context.mjs";
|
|
2
2
|
import { ResolverResult, RunFn } from "./typeUtils.mjs";
|
|
3
|
-
//#region src/makeRunInputMutation.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Creates a `makeRunInputMutation` function for each project's `testUtils` file.
|
|
6
5
|
*
|
|
@@ -19,6 +18,5 @@ type RunInputMutationMethod<C, T> = <I extends MutationInput<T>, R = ResolverRes
|
|
|
19
18
|
type MutationInput<T> = T[keyof T] extends Resolver<any, {
|
|
20
19
|
input: infer I;
|
|
21
20
|
}, any> ? I : never;
|
|
22
|
-
//#endregion
|
|
23
21
|
export {};
|
|
24
22
|
//# sourceMappingURL=makeRunInputMutation.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeRunInputMutation.d.mts","names":[],"sources":["../src/makeRunInputMutation.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"makeRunInputMutation.d.mts","names":[],"sources":["../src/makeRunInputMutation.ts"],"mappings":";;;;;;;;wBASgB,yBAAyB,GAAG,OAAO,MAAM,KAAK,qBAAqB;;;;;;YAoBvE,qBAAqB,MAAM,kBAAkB,UAAU,MAAM,uBAAuB,GAAG;KAE9F,uBAAuB,GAAG,MAAM,UAAU,cAAc,IAAI,IAAI,eAAe,SAAS,IAC3F,KAAK,GACL,OAAO,WAAW,OACf,QAAQ;;KAGR,cAAc,KAAK,QAAQ,WAAW;EAAgB,aAAa;UAAY"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./context.js";
|
|
2
2
|
import "./typeUtils.js";
|
|
3
|
-
|
|
3
|
+
// src/makeRunInputMutation.ts
|
|
4
4
|
/**
|
|
5
5
|
* Creates a `makeRunInputMutation` function for each project's `testUtils` file.
|
|
6
6
|
*
|
|
@@ -14,7 +14,6 @@ function makeMakeRunInputMutation(runFn) {
|
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
//#endregion
|
|
18
17
|
export { makeMakeRunInputMutation };
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=makeRunInputMutation.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./typeUtils.cjs");
|
|
3
3
|
let joist_core = require("joist-core");
|
|
4
|
-
|
|
4
|
+
// src/makeRunObjectField.ts
|
|
5
5
|
/**
|
|
6
6
|
* Creates a `makeRunObjectField` function for each project's `testUtils` file.
|
|
7
7
|
*
|
|
@@ -16,7 +16,6 @@ function makeMakeRunObjectField(runFn) {
|
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
//#endregion
|
|
20
19
|
exports.makeMakeRunObjectField = makeMakeRunObjectField;
|
|
21
20
|
|
|
22
21
|
//# sourceMappingURL=makeRunObjectField.cjs.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ResolverArgs, ResolverResult, ResolverRoot, RunFn } from "./typeUtils.cjs";
|
|
2
|
-
//#region src/makeRunObjectField.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Creates a `makeRunObjectField` function for each project's `testUtils` file.
|
|
5
4
|
*
|
|
@@ -11,6 +10,5 @@ export declare function makeMakeRunObjectField<C>(runFn: RunFn<C>): MakeRunObjec
|
|
|
11
10
|
export type MakeRunObjectField<C> = <T extends object, R extends ResolverRoot<T>>(resolvers: T) => RunObjectFieldMethod<C, T, R>;
|
|
12
11
|
/** The return type of `makeRunObject`. */
|
|
13
12
|
type RunObjectFieldMethod<C, T, R> = <K extends keyof T, A extends ResolverArgs<T, K>>(ctx: C, root: R, key: K, args?: A | ((root: R) => A)) => Promise<ResolverResult<T, K>>;
|
|
14
|
-
//#endregion
|
|
15
13
|
export {};
|
|
16
14
|
//# sourceMappingURL=makeRunObjectField.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeRunObjectField.d.cts","names":[],"sources":["../src/makeRunObjectField.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"makeRunObjectField.d.cts","names":[],"sources":["../src/makeRunObjectField.ts"],"mappings":";;;;;;;wBAUgB,uBAAuB,GAAG,OAAO,MAAM,KAAK,mBAAmB;;YAYnE,mBAAmB,MAAM,kBAAkB,UAAU,aAAa,IAC5E,WAAW,MACR,qBAAqB,GAAG,GAAG;;KAG3B,qBAAqB,GAAG,GAAG,MAAM,gBAAgB,GAAG,UAAU,aAAa,GAAG,IACjF,KAAK,GACL,MAAM,GACN,KAAK,GAEL,OAAO,MAAM,MAAM,MAAM,OACtB,QAAQ,eAAe,GAAG"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ResolverArgs, ResolverResult, ResolverRoot, RunFn } from "./typeUtils.mjs";
|
|
2
|
-
//#region src/makeRunObjectField.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Creates a `makeRunObjectField` function for each project's `testUtils` file.
|
|
5
4
|
*
|
|
@@ -11,6 +10,5 @@ export declare function makeMakeRunObjectField<C>(runFn: RunFn<C>): MakeRunObjec
|
|
|
11
10
|
export type MakeRunObjectField<C> = <T extends object, R extends ResolverRoot<T>>(resolvers: T) => RunObjectFieldMethod<C, T, R>;
|
|
12
11
|
/** The return type of `makeRunObject`. */
|
|
13
12
|
type RunObjectFieldMethod<C, T, R> = <K extends keyof T, A extends ResolverArgs<T, K>>(ctx: C, root: R, key: K, args?: A | ((root: R) => A)) => Promise<ResolverResult<T, K>>;
|
|
14
|
-
//#endregion
|
|
15
13
|
export {};
|
|
16
14
|
//# sourceMappingURL=makeRunObjectField.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeRunObjectField.d.mts","names":[],"sources":["../src/makeRunObjectField.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"makeRunObjectField.d.mts","names":[],"sources":["../src/makeRunObjectField.ts"],"mappings":";;;;;;;wBAUgB,uBAAuB,GAAG,OAAO,MAAM,KAAK,mBAAmB;;YAYnE,mBAAmB,MAAM,kBAAkB,UAAU,aAAa,IAC5E,WAAW,MACR,qBAAqB,GAAG,GAAG;;KAG3B,qBAAqB,GAAG,GAAG,MAAM,gBAAgB,GAAG,UAAU,aAAa,GAAG,IACjF,KAAK,GACL,MAAM,GACN,KAAK,GAEL,OAAO,MAAM,MAAM,MAAM,OACtB,QAAQ,eAAe,GAAG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./typeUtils.js";
|
|
2
2
|
import { isEntity } from "joist-core";
|
|
3
|
-
|
|
3
|
+
// src/makeRunObjectField.ts
|
|
4
4
|
/**
|
|
5
5
|
* Creates a `makeRunObjectField` function for each project's `testUtils` file.
|
|
6
6
|
*
|
|
@@ -15,7 +15,6 @@ function makeMakeRunObjectField(runFn) {
|
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
export { makeMakeRunObjectField };
|
|
20
19
|
|
|
21
20
|
//# sourceMappingURL=makeRunObjectField.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./typeUtils.cjs");
|
|
3
3
|
let joist_core = require("joist-core");
|
|
4
|
-
|
|
4
|
+
// src/makeRunObjectFields.ts
|
|
5
5
|
/**
|
|
6
6
|
* Creates a `makeRunObjectFields` function for each project's `testUtils` file.
|
|
7
7
|
*
|
|
@@ -18,7 +18,6 @@ function makeMakeRunObjectFields(runFn) {
|
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
exports.makeMakeRunObjectFields = makeMakeRunObjectFields;
|
|
23
22
|
|
|
24
23
|
//# sourceMappingURL=makeRunObjectFields.cjs.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ResolverResult, ResolverRoot, RunFn } from "./typeUtils.cjs";
|
|
2
|
-
//#region src/makeRunObjectFields.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Creates a `makeRunObjectFields` function for each project's `testUtils` file.
|
|
5
4
|
*
|
|
@@ -10,6 +9,5 @@ export declare function makeMakeRunObjectFields<C, T>(runFn: RunFn<C>): MakeRunO
|
|
|
10
9
|
/** Creates a `run` method that can invoke multiple fields against an object resolver. */
|
|
11
10
|
export type MakeRunObjectFields<C> = <T, R extends ResolverRoot<T>>(resolvers: T) => RunFieldsResolverMethod<C, T, R>;
|
|
12
11
|
type RunFieldsResolverMethod<C, T, R extends ResolverRoot<T>> = <K extends (keyof T)[]>(ctx: C, root: R, keys: K) => Promise<{ [k in K[number]]: ResolverResult<T, k>; }>;
|
|
13
|
-
//#endregion
|
|
14
12
|
export {};
|
|
15
13
|
//# sourceMappingURL=makeRunObjectFields.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeRunObjectFields.d.cts","names":[],"sources":["../src/makeRunObjectFields.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"makeRunObjectFields.d.cts","names":[],"sources":["../src/makeRunObjectFields.ts"],"mappings":";;;;;;;wBAUgB,wBAAwB,GAAG,GAAG,OAAO,MAAM,KAAK,oBAAoB;;YAgBxE,oBAAoB,MAAM,GAAG,UAAU,aAAa,IAAI,WAAW,MAAM,wBAAwB,GAAG,GAAG;KAG9G,wBAAwB,GAAG,GAAG,UAAU,aAAa,OAAO,iBAAiB,MAChF,KAAK,GACL,MAAM,GACN,MAAM,MACH,WAAW,KAAK,YAAY,eAAe,GAAG"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ResolverResult, ResolverRoot, RunFn } from "./typeUtils.mjs";
|
|
2
|
-
//#region src/makeRunObjectFields.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Creates a `makeRunObjectFields` function for each project's `testUtils` file.
|
|
5
4
|
*
|
|
@@ -10,6 +9,5 @@ export declare function makeMakeRunObjectFields<C, T>(runFn: RunFn<C>): MakeRunO
|
|
|
10
9
|
/** Creates a `run` method that can invoke multiple fields against an object resolver. */
|
|
11
10
|
export type MakeRunObjectFields<C> = <T, R extends ResolverRoot<T>>(resolvers: T) => RunFieldsResolverMethod<C, T, R>;
|
|
12
11
|
type RunFieldsResolverMethod<C, T, R extends ResolverRoot<T>> = <K extends (keyof T)[]>(ctx: C, root: R, keys: K) => Promise<{ [k in K[number]]: ResolverResult<T, k>; }>;
|
|
13
|
-
//#endregion
|
|
14
12
|
export {};
|
|
15
13
|
//# sourceMappingURL=makeRunObjectFields.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeRunObjectFields.d.mts","names":[],"sources":["../src/makeRunObjectFields.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"makeRunObjectFields.d.mts","names":[],"sources":["../src/makeRunObjectFields.ts"],"mappings":";;;;;;;wBAUgB,wBAAwB,GAAG,GAAG,OAAO,MAAM,KAAK,oBAAoB;;YAgBxE,oBAAoB,MAAM,GAAG,UAAU,aAAa,IAAI,WAAW,MAAM,wBAAwB,GAAG,GAAG;KAG9G,wBAAwB,GAAG,GAAG,UAAU,aAAa,OAAO,iBAAiB,MAChF,KAAK,GACL,MAAM,GACN,MAAM,MACH,WAAW,KAAK,YAAY,eAAe,GAAG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./typeUtils.js";
|
|
2
2
|
import { isEntity } from "joist-core";
|
|
3
|
-
|
|
3
|
+
// src/makeRunObjectFields.ts
|
|
4
4
|
/**
|
|
5
5
|
* Creates a `makeRunObjectFields` function for each project's `testUtils` file.
|
|
6
6
|
*
|
|
@@ -17,7 +17,6 @@ function makeMakeRunObjectFields(runFn) {
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { makeMakeRunObjectFields };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=makeRunObjectFields.js.map
|
package/build/makeRunQuery.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./typeUtils.cjs");
|
|
3
|
-
|
|
3
|
+
// src/makeRunQuery.ts
|
|
4
4
|
/**
|
|
5
5
|
* Creates a `makeRunQuery` function for each project's `testUtils` file.
|
|
6
6
|
*
|
|
@@ -14,7 +14,6 @@ function makeMakeRunQuery(runFn) {
|
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
//#endregion
|
|
18
17
|
exports.makeMakeRunQuery = makeMakeRunQuery;
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=makeRunQuery.cjs.map
|
package/build/makeRunQuery.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ResolverArgs, ResolverResult, RunFn } from "./typeUtils.cjs";
|
|
2
|
-
//#region src/makeRunQuery.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Creates a `makeRunQuery` function for each project's `testUtils` file.
|
|
5
4
|
*
|
|
@@ -15,6 +14,5 @@ export declare function makeMakeRunQuery<C>(runFn: RunFn<C>): MakeRunQuery<C>;
|
|
|
15
14
|
export type MakeRunQuery<C> = <T extends object>(resolver: T) => RunQueryMethod<C, T>;
|
|
16
15
|
/** The return type of `makeRunQuery`. */
|
|
17
16
|
type RunQueryMethod<C, T> = <A extends ResolverArgs<T, keyof T>>(ctx: C, args?: A | (() => A)) => Promise<ResolverResult<T, keyof T>>;
|
|
18
|
-
//#endregion
|
|
19
17
|
export {};
|
|
20
18
|
//# sourceMappingURL=makeRunQuery.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeRunQuery.d.cts","names":[],"sources":["../src/makeRunQuery.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"makeRunQuery.d.cts","names":[],"sources":["../src/makeRunQuery.ts"],"mappings":";;;;;;;wBAQgB,iBAAiB,GAAG,OAAO,MAAM,KAAK,aAAa;;;;;;YAevD,aAAa,MAAM,kBAAkB,UAAU,MAAM,eAAe,GAAG;;KAG9E,eAAe,GAAG,MAAM,UAAU,aAAa,SAAS,IAC3D,KAAK,GAEL,OAAO,WAAW,OACf,QAAQ,eAAe,SAAS"}
|
package/build/makeRunQuery.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ResolverArgs, ResolverResult, RunFn } from "./typeUtils.mjs";
|
|
2
|
-
//#region src/makeRunQuery.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Creates a `makeRunQuery` function for each project's `testUtils` file.
|
|
5
4
|
*
|
|
@@ -15,6 +14,5 @@ export declare function makeMakeRunQuery<C>(runFn: RunFn<C>): MakeRunQuery<C>;
|
|
|
15
14
|
export type MakeRunQuery<C> = <T extends object>(resolver: T) => RunQueryMethod<C, T>;
|
|
16
15
|
/** The return type of `makeRunQuery`. */
|
|
17
16
|
type RunQueryMethod<C, T> = <A extends ResolverArgs<T, keyof T>>(ctx: C, args?: A | (() => A)) => Promise<ResolverResult<T, keyof T>>;
|
|
18
|
-
//#endregion
|
|
19
17
|
export {};
|
|
20
18
|
//# sourceMappingURL=makeRunQuery.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeRunQuery.d.mts","names":[],"sources":["../src/makeRunQuery.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"makeRunQuery.d.mts","names":[],"sources":["../src/makeRunQuery.ts"],"mappings":";;;;;;;wBAQgB,iBAAiB,GAAG,OAAO,MAAM,KAAK,aAAa;;;;;;YAevD,aAAa,MAAM,kBAAkB,UAAU,MAAM,eAAe,GAAG;;KAG9E,eAAe,GAAG,MAAM,UAAU,aAAa,SAAS,IAC3D,KAAK,GAEL,OAAO,WAAW,OACf,QAAQ,eAAe,SAAS"}
|
package/build/makeRunQuery.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./typeUtils.js";
|
|
2
|
-
|
|
2
|
+
// src/makeRunQuery.ts
|
|
3
3
|
/**
|
|
4
4
|
* Creates a `makeRunQuery` function for each project's `testUtils` file.
|
|
5
5
|
*
|
|
@@ -13,7 +13,6 @@ function makeMakeRunQuery(runFn) {
|
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
//#endregion
|
|
17
16
|
export { makeMakeRunQuery };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=makeRunQuery.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let joist_core = require("joist-core");
|
|
3
|
-
|
|
3
|
+
// src/paginationUtils.ts
|
|
4
4
|
const defaultLimit = 100;
|
|
5
5
|
/** Executes an entity selection after pagination has been applied. */
|
|
6
6
|
function queryEntities(ctx, base) {
|
|
@@ -26,7 +26,6 @@ async function countQuery(ctx, base) {
|
|
|
26
26
|
});
|
|
27
27
|
return result.count;
|
|
28
28
|
}
|
|
29
|
-
//#endregion
|
|
30
29
|
exports.countQuery = countQuery;
|
|
31
30
|
exports.defaultLimit = defaultLimit;
|
|
32
31
|
exports.queryEntities = queryEntities;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Entity, EntityColumn, EntityManager, GraphQLFilterWithAlias, Query, QueryJoinList, TableFor } from "joist-core";
|
|
2
|
-
//#region src/paginationUtils.d.ts
|
|
3
2
|
export type ContextWithEm = {
|
|
4
3
|
em: EntityManager;
|
|
5
4
|
};
|
|
@@ -12,5 +11,4 @@ export declare const defaultLimit = 100;
|
|
|
12
11
|
export declare function queryEntities<T extends Entity>(ctx: ContextWithEm, base: PaginationQuery<T>): Promise<T[]>;
|
|
13
12
|
/** Counts the unpaginated rows, preserving distinct, grouping, and join semantics. */
|
|
14
13
|
export declare function countQuery<T extends Entity>(ctx: ContextWithEm, base: PaginationQuery<T>): Promise<number>;
|
|
15
|
-
//#endregion
|
|
16
14
|
//# sourceMappingURL=paginationUtils.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paginationUtils.d.cts","names":[],"sources":["../src/paginationUtils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"paginationUtils.d.cts","names":[],"sources":["../src/paginationUtils.ts"],"mappings":";YAYY;EAAkB,IAAI;;YACtB,iBAAiB,UAAU,UAAU,uBAAuB;YAC5D,gBAAgB,UAAU,UAAU,MAC9C,SAAS;WAAgB,IAAI,aAAa;GAC1C;qBAGW;;wBAGG,cAAc,UAAU,QAAQ,KAAK,eAAe,MAAM,gBAAgB,KAAK,QAAQ;;wBAMjF,WAAW,UAAU,QAAQ,KAAK,eAAe,MAAM,gBAAgB,KAAK"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Entity, EntityColumn, EntityManager, GraphQLFilterWithAlias, Query, QueryJoinList, TableFor } from "joist-core";
|
|
2
|
-
//#region src/paginationUtils.d.ts
|
|
3
2
|
export type ContextWithEm = {
|
|
4
3
|
em: EntityManager;
|
|
5
4
|
};
|
|
@@ -12,5 +11,4 @@ export declare const defaultLimit = 100;
|
|
|
12
11
|
export declare function queryEntities<T extends Entity>(ctx: ContextWithEm, base: PaginationQuery<T>): Promise<T[]>;
|
|
13
12
|
/** Counts the unpaginated rows, preserving distinct, grouping, and join semantics. */
|
|
14
13
|
export declare function countQuery<T extends Entity>(ctx: ContextWithEm, base: PaginationQuery<T>): Promise<number>;
|
|
15
|
-
//#endregion
|
|
16
14
|
//# sourceMappingURL=paginationUtils.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paginationUtils.d.mts","names":[],"sources":["../src/paginationUtils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"paginationUtils.d.mts","names":[],"sources":["../src/paginationUtils.ts"],"mappings":";YAYY;EAAkB,IAAI;;YACtB,iBAAiB,UAAU,UAAU,uBAAuB;YAC5D,gBAAgB,UAAU,UAAU,MAC9C,SAAS;WAAgB,IAAI,aAAa;GAC1C;qBAGW;;wBAGG,cAAc,UAAU,QAAQ,KAAK,eAAe,MAAM,gBAAgB,KAAK,QAAQ;;wBAMjF,WAAW,UAAU,QAAQ,KAAK,eAAe,MAAM,gBAAgB,KAAK"}
|
package/build/paginationUtils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { query } from "joist-core";
|
|
2
|
-
|
|
2
|
+
// src/paginationUtils.ts
|
|
3
3
|
const defaultLimit = 100;
|
|
4
4
|
/** Executes an entity selection after pagination has been applied. */
|
|
5
5
|
function queryEntities(ctx, base) {
|
|
@@ -25,7 +25,6 @@ async function countQuery(ctx, base) {
|
|
|
25
25
|
});
|
|
26
26
|
return result.count;
|
|
27
27
|
}
|
|
28
|
-
//#endregion
|
|
29
28
|
export { countQuery, defaultLimit, queryEntities };
|
|
30
29
|
|
|
31
30
|
//# sourceMappingURL=paginationUtils.js.map
|
package/build/saveEntity.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let joist_core = require("joist-core");
|
|
3
3
|
require("joist-test-utils");
|
|
4
|
-
|
|
4
|
+
// src/saveEntity.ts
|
|
5
5
|
/** Given an GraphQL input, creates-or-updates an entity of `type`. */
|
|
6
6
|
async function saveEntity(ctx, type, input, opts = {}) {
|
|
7
7
|
return saveEntities(ctx, type, [input], opts).then((r) => r[0]);
|
|
@@ -17,7 +17,6 @@ async function saveEntities(ctx, type, input, opts = {}) {
|
|
|
17
17
|
if (flush) await ctx.em.flush();
|
|
18
18
|
return (0, joist_core.failIfAnyRejected)(results);
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
exports.saveEntities = saveEntities;
|
|
22
21
|
exports.saveEntity = saveEntity;
|
|
23
22
|
|
package/build/saveEntity.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DeepPartialOrNull, Entity, EntityConstructor, OptsOf } from "joist-core";
|
|
2
2
|
import { Context } from "joist-test-utils";
|
|
3
|
-
//#region src/saveEntity.d.ts
|
|
4
3
|
/** Given an GraphQL input, creates-or-updates an entity of `type`. */
|
|
5
4
|
export declare function saveEntity<T extends Entity>(ctx: Context, type: EntityConstructor<T>, input: DeepPartialOrNull<T>, opts?: {
|
|
6
5
|
flush?: boolean;
|
|
@@ -10,5 +9,4 @@ export declare function saveEntities<T extends Entity>(ctx: Context, type: Entit
|
|
|
10
9
|
flush?: boolean;
|
|
11
10
|
opts?: Partial<OptsOf<T>>;
|
|
12
11
|
}): Promise<T[]>;
|
|
13
|
-
//#endregion
|
|
14
12
|
//# sourceMappingURL=saveEntity.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saveEntity.d.cts","names":[],"sources":["../src/saveEntity.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"saveEntity.d.cts","names":[],"sources":["../src/saveEntity.ts"],"mappings":";;;wBAUsB,WAAW,UAAU,QACzC,KAAK,SACL,MAAM,kBAAkB,IACxB,OAAO,kBAAkB,IACzB;EAAQ;IACP,QAAQ;;wBAKW,aAAa,UAAU,QAC3C,KAAK,SACL,MAAM,kBAAkB,IACxB,gBAAgB,kBAAkB,MAClC;EAAQ;EAAiB,OAAO,QAAQ,OAAO;IAC9C,QAAQ"}
|
package/build/saveEntity.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DeepPartialOrNull, Entity, EntityConstructor, OptsOf } from "joist-core";
|
|
2
2
|
import { Context } from "joist-test-utils";
|
|
3
|
-
//#region src/saveEntity.d.ts
|
|
4
3
|
/** Given an GraphQL input, creates-or-updates an entity of `type`. */
|
|
5
4
|
export declare function saveEntity<T extends Entity>(ctx: Context, type: EntityConstructor<T>, input: DeepPartialOrNull<T>, opts?: {
|
|
6
5
|
flush?: boolean;
|
|
@@ -10,5 +9,4 @@ export declare function saveEntities<T extends Entity>(ctx: Context, type: Entit
|
|
|
10
9
|
flush?: boolean;
|
|
11
10
|
opts?: Partial<OptsOf<T>>;
|
|
12
11
|
}): Promise<T[]>;
|
|
13
|
-
//#endregion
|
|
14
12
|
//# sourceMappingURL=saveEntity.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saveEntity.d.mts","names":[],"sources":["../src/saveEntity.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"saveEntity.d.mts","names":[],"sources":["../src/saveEntity.ts"],"mappings":";;;wBAUsB,WAAW,UAAU,QACzC,KAAK,SACL,MAAM,kBAAkB,IACxB,OAAO,kBAAkB,IACzB;EAAQ;IACP,QAAQ;;wBAKW,aAAa,UAAU,QAC3C,KAAK,SACL,MAAM,kBAAkB,IACxB,gBAAgB,kBAAkB,MAClC;EAAQ;EAAiB,OAAO,QAAQ,OAAO;IAC9C,QAAQ"}
|
package/build/saveEntity.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { failIfAnyRejected } from "joist-core";
|
|
2
2
|
import "joist-test-utils";
|
|
3
|
-
|
|
3
|
+
// src/saveEntity.ts
|
|
4
4
|
/** Given an GraphQL input, creates-or-updates an entity of `type`. */
|
|
5
5
|
async function saveEntity(ctx, type, input, opts = {}) {
|
|
6
6
|
return saveEntities(ctx, type, [input], opts).then((r) => r[0]);
|
|
@@ -16,7 +16,6 @@ async function saveEntities(ctx, type, input, opts = {}) {
|
|
|
16
16
|
if (flush) await ctx.em.flush();
|
|
17
17
|
return failIfAnyRejected(results);
|
|
18
18
|
}
|
|
19
|
-
//#endregion
|
|
20
19
|
export { saveEntities, saveEntity };
|
|
21
20
|
|
|
22
21
|
//# sourceMappingURL=saveEntity.js.map
|
package/build/tests.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ResolverArgs, ResolverResult, ResolverRoot, RunFn } from "./typeUtils.cjs";
|
|
2
1
|
import { MakeRunInputMutation, makeMakeRunInputMutation } from "./makeRunInputMutation.cjs";
|
|
3
2
|
import { MakeRunObjectField, makeMakeRunObjectField } from "./makeRunObjectField.cjs";
|
|
4
3
|
import { MakeRunObjectFields, makeMakeRunObjectFields } from "./makeRunObjectFields.cjs";
|
|
5
4
|
import { MakeRunQuery, makeMakeRunQuery } from "./makeRunQuery.cjs";
|
|
5
|
+
import { ResolverArgs, ResolverResult, ResolverRoot, RunFn } from "./typeUtils.cjs";
|
|
6
6
|
export { type MakeRunInputMutation, type MakeRunObjectField, type MakeRunObjectFields, type MakeRunQuery, type ResolverArgs, type ResolverResult, type ResolverRoot, type RunFn, makeMakeRunInputMutation, makeMakeRunObjectField, makeMakeRunObjectFields, makeMakeRunQuery };
|
package/build/tests.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ResolverArgs, ResolverResult, ResolverRoot, RunFn } from "./typeUtils.mjs";
|
|
2
1
|
import { MakeRunInputMutation, makeMakeRunInputMutation } from "./makeRunInputMutation.mjs";
|
|
3
2
|
import { MakeRunObjectField, makeMakeRunObjectField } from "./makeRunObjectField.mjs";
|
|
4
3
|
import { MakeRunObjectFields, makeMakeRunObjectFields } from "./makeRunObjectFields.mjs";
|
|
5
4
|
import { MakeRunQuery, makeMakeRunQuery } from "./makeRunQuery.mjs";
|
|
5
|
+
import { ResolverArgs, ResolverResult, ResolverRoot, RunFn } from "./typeUtils.mjs";
|
|
6
6
|
export { type MakeRunInputMutation, type MakeRunObjectField, type MakeRunObjectFields, type MakeRunQuery, type ResolverArgs, type ResolverResult, type ResolverRoot, type RunFn, makeMakeRunInputMutation, makeMakeRunObjectField, makeMakeRunObjectFields, makeMakeRunQuery };
|
package/build/typeUtils.d.cts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Resolver } from "./context.cjs";
|
|
2
|
-
//#region src/typeUtils.d.ts
|
|
3
2
|
export type RunFn<C> = <T>(ctx: C, fn: (ctx: C) => Promise<T>) => Promise<T>;
|
|
4
3
|
/** Infers the root type of the given resolver, by assuming it's always the first arg. */
|
|
5
4
|
export type ResolverRoot<T> = T extends { [key in keyof T]: infer F; } ? F extends Resolver<infer R, any, any> ? R : never : never;
|
|
6
5
|
export type ResolverArgs<T, K extends keyof T> = T[K] extends Resolver<any, infer U, any> ? U : never;
|
|
7
6
|
/** Infers the return type of key `K` in the resolver object `T`. */
|
|
8
7
|
export type ResolverResult<T, K extends keyof T> = T[K] extends Resolver<any, any, infer U> ? U : never;
|
|
9
|
-
//#endregion
|
|
10
8
|
//# sourceMappingURL=typeUtils.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeUtils.d.cts","names":[],"sources":["../src/typeUtils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"typeUtils.d.cts","names":[],"sources":["../src/typeUtils.ts"],"mappings":";YAEY,MAAM,MAAM,GAAG,KAAK,GAAG,KAAK,KAAK,MAAM,QAAQ,OAAO,QAAQ;;YAG9D,aAAa,KAAK,aAAa,aAAa,UAAU,OAC9D,UAAU,eAAe,eACvB;YAIM,aAAa,GAAG,gBAAgB,KAAK,EAAE,WAAW,oBAAoB,UAAU;;YAGhF,eAAe,GAAG,gBAAgB,KAAK,EAAE,WAAW,yBAAyB,KAAK"}
|
package/build/typeUtils.d.mts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Resolver } from "./context.mjs";
|
|
2
|
-
//#region src/typeUtils.d.ts
|
|
3
2
|
export type RunFn<C> = <T>(ctx: C, fn: (ctx: C) => Promise<T>) => Promise<T>;
|
|
4
3
|
/** Infers the root type of the given resolver, by assuming it's always the first arg. */
|
|
5
4
|
export type ResolverRoot<T> = T extends { [key in keyof T]: infer F; } ? F extends Resolver<infer R, any, any> ? R : never : never;
|
|
6
5
|
export type ResolverArgs<T, K extends keyof T> = T[K] extends Resolver<any, infer U, any> ? U : never;
|
|
7
6
|
/** Infers the return type of key `K` in the resolver object `T`. */
|
|
8
7
|
export type ResolverResult<T, K extends keyof T> = T[K] extends Resolver<any, any, infer U> ? U : never;
|
|
9
|
-
//#endregion
|
|
10
8
|
//# sourceMappingURL=typeUtils.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeUtils.d.mts","names":[],"sources":["../src/typeUtils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"typeUtils.d.mts","names":[],"sources":["../src/typeUtils.ts"],"mappings":";YAEY,MAAM,MAAM,GAAG,KAAK,GAAG,KAAK,KAAK,MAAM,QAAQ,OAAO,QAAQ;;YAG9D,aAAa,KAAK,aAAa,aAAa,UAAU,OAC9D,UAAU,eAAe,eACvB;YAIM,aAAa,GAAG,gBAAgB,KAAK,EAAE,WAAW,oBAAoB,UAAU;;YAGhF,eAAe,GAAG,gBAAgB,KAAK,EAAE,WAAW,yBAAyB,KAAK"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "joist-graphql-resolver-utils",
|
|
3
|
-
"version": "2.5.0-next.
|
|
3
|
+
"version": "2.5.0-next.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -84,17 +84,17 @@
|
|
|
84
84
|
"build"
|
|
85
85
|
],
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"joist-core": "2.5.0-next.
|
|
88
|
-
"joist-test-utils": "2.5.0-next.
|
|
87
|
+
"joist-core": "2.5.0-next.9",
|
|
88
|
+
"joist-test-utils": "2.5.0-next.9"
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"graphql": "^17.0.2"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
|
-
"@swc/core": "1.16.
|
|
94
|
+
"@swc/core": "1.16.21",
|
|
95
95
|
"@swc/jest": "^0.2.39",
|
|
96
96
|
"@types/jest": "^30.0.0",
|
|
97
|
-
"@types/node": "^26.6.
|
|
97
|
+
"@types/node": "^26.6.6",
|
|
98
98
|
"jest": "30.4.2",
|
|
99
99
|
"tsconfig-paths": "^4.2.0",
|
|
100
100
|
"typescript": "7.0.2"
|