@pothos/plugin-prisma 3.58.0 → 3.59.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dts/connection-helpers.d.ts +6 -6
- package/dts/connection-helpers.d.ts.map +1 -1
- package/dts/global-types.d.ts +13 -13
- package/dts/global-types.d.ts.map +1 -1
- package/dts/index.d.ts.map +1 -1
- package/dts/interface-ref.d.ts +1 -1
- package/dts/interface-ref.d.ts.map +1 -1
- package/dts/model-loader.d.ts +32 -13
- package/dts/model-loader.d.ts.map +1 -1
- package/dts/object-ref.d.ts.map +1 -1
- package/dts/prisma-field-builder.d.ts +18 -18
- package/dts/prisma-field-builder.d.ts.map +1 -1
- package/dts/types.d.ts +30 -30
- package/dts/types.d.ts.map +1 -1
- package/dts/util/loader-map.d.ts +1 -1
- package/dts/util/loader-map.d.ts.map +1 -1
- package/dts/util/map-query.d.ts +2 -2
- package/dts/util/map-query.d.ts.map +1 -1
- package/esm/connection-helpers.d.ts +6 -6
- package/esm/connection-helpers.d.ts.map +1 -1
- package/esm/global-types.d.ts +13 -13
- package/esm/global-types.d.ts.map +1 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -9
- package/esm/index.js.map +1 -1
- package/esm/interface-ref.d.ts +1 -1
- package/esm/interface-ref.d.ts.map +1 -1
- package/esm/interface-ref.js.map +1 -1
- package/esm/model-loader.d.ts +32 -13
- package/esm/model-loader.d.ts.map +1 -1
- package/esm/model-loader.js +82 -27
- package/esm/model-loader.js.map +1 -1
- package/esm/object-ref.d.ts.map +1 -1
- package/esm/object-ref.js.map +1 -1
- package/esm/prisma-field-builder.d.ts +28 -28
- package/esm/prisma-field-builder.d.ts.map +1 -1
- package/esm/prisma-field-builder.js.map +1 -1
- package/esm/types.d.ts +30 -30
- package/esm/types.d.ts.map +1 -1
- package/esm/util/loader-map.d.ts +1 -1
- package/esm/util/loader-map.d.ts.map +1 -1
- package/esm/util/loader-map.js +1 -1
- package/esm/util/loader-map.js.map +1 -1
- package/esm/util/map-query.d.ts +2 -2
- package/esm/util/map-query.d.ts.map +1 -1
- package/esm/util/map-query.js +10 -2
- package/esm/util/map-query.js.map +1 -1
- package/lib/index.js +1 -8
- package/lib/index.js.map +1 -1
- package/lib/interface-ref.js.map +1 -1
- package/lib/model-loader.js +81 -27
- package/lib/model-loader.js.map +1 -1
- package/lib/object-ref.js.map +1 -1
- package/lib/prisma-field-builder.js.map +1 -1
- package/lib/util/loader-map.js +1 -1
- package/lib/util/loader-map.js.map +1 -1
- package/lib/util/map-query.js +9 -1
- package/lib/util/map-query.js.map +1 -1
- package/package.json +6 -6
- package/src/connection-helpers.ts +5 -5
- package/src/global-types.ts +11 -11
- package/src/index.ts +8 -18
- package/src/interface-ref.ts +3 -2
- package/src/model-loader.ts +118 -41
- package/src/object-ref.ts +2 -0
- package/src/prisma-field-builder.ts +42 -32
- package/src/types.ts +52 -50
- package/src/util/loader-map.ts +1 -1
- package/src/util/map-query.ts +16 -3
package/src/util/map-query.ts
CHANGED
|
@@ -4,12 +4,15 @@ import {
|
|
|
4
4
|
FieldNode,
|
|
5
5
|
FragmentDefinitionNode,
|
|
6
6
|
getArgumentValues,
|
|
7
|
+
getDirectiveValues,
|
|
7
8
|
getNamedType,
|
|
8
9
|
GraphQLField,
|
|
10
|
+
GraphQLIncludeDirective,
|
|
9
11
|
GraphQLInterfaceType,
|
|
10
12
|
GraphQLNamedType,
|
|
11
13
|
GraphQLObjectType,
|
|
12
14
|
GraphQLResolveInfo,
|
|
15
|
+
GraphQLSkipDirective,
|
|
13
16
|
InlineFragmentNode,
|
|
14
17
|
isInterfaceType,
|
|
15
18
|
isObjectType,
|
|
@@ -198,7 +201,7 @@ function resolveIndirectInclude(
|
|
|
198
201
|
}
|
|
199
202
|
|
|
200
203
|
function addNestedSelections(
|
|
201
|
-
type:
|
|
204
|
+
type: GraphQLInterfaceType | GraphQLObjectType,
|
|
202
205
|
context: object,
|
|
203
206
|
info: GraphQLResolveInfo,
|
|
204
207
|
state: SelectionState,
|
|
@@ -260,7 +263,7 @@ function addNestedSelections(
|
|
|
260
263
|
}
|
|
261
264
|
|
|
262
265
|
function addFieldSelection(
|
|
263
|
-
type:
|
|
266
|
+
type: GraphQLInterfaceType | GraphQLObjectType,
|
|
264
267
|
context: object,
|
|
265
268
|
info: GraphQLResolveInfo,
|
|
266
269
|
state: SelectionState,
|
|
@@ -271,6 +274,16 @@ function addFieldSelection(
|
|
|
271
274
|
return;
|
|
272
275
|
}
|
|
273
276
|
|
|
277
|
+
const skip = getDirectiveValues(GraphQLSkipDirective, selection, info.variableValues);
|
|
278
|
+
if (skip?.if === true) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
const include = getDirectiveValues(GraphQLIncludeDirective, selection, info.variableValues);
|
|
283
|
+
if (include?.if === false) {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
|
|
274
287
|
const field = type.getFields()[selection.name.value];
|
|
275
288
|
|
|
276
289
|
if (!field) {
|
|
@@ -397,7 +410,7 @@ export function queryFromInfo<T extends SelectionMap['select'] | undefined = und
|
|
|
397
410
|
path?: string[];
|
|
398
411
|
paths?: string[][];
|
|
399
412
|
withUsageCheck?: boolean;
|
|
400
|
-
}): {
|
|
413
|
+
}): { include?: {} } | { select: T } {
|
|
401
414
|
const returnType = getNamedType(info.returnType);
|
|
402
415
|
const type = typeName ? info.schema.getTypeMap()[typeName] : returnType;
|
|
403
416
|
|