@cosmneo/onion-lasagna 0.3.0 → 0.4.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/{chunk-XWKHOLIP.js → chunk-4HMXTGHK.js} +2 -2
- package/dist/chunk-4RFWJ5XZ.js +192 -0
- package/dist/chunk-4RFWJ5XZ.js.map +1 -0
- package/dist/{chunk-4BVOLXDJ.js → chunk-4YBAV6LZ.js} +2 -2
- package/dist/chunk-ANLXZHUS.js +230 -0
- package/dist/chunk-ANLXZHUS.js.map +1 -0
- package/dist/chunk-BG2FY27M.js +36 -0
- package/dist/chunk-BG2FY27M.js.map +1 -0
- package/dist/chunk-FEY2GSVT.js +1 -0
- package/dist/chunk-FEY2GSVT.js.map +1 -0
- package/dist/{chunk-2BVCU32G.js → chunk-HNEAH6OZ.js} +121 -2
- package/dist/chunk-HNEAH6OZ.js.map +1 -0
- package/dist/chunk-NQMFWI6Q.js +1 -0
- package/dist/chunk-NQMFWI6Q.js.map +1 -0
- package/dist/chunk-TZRBETT3.js +127 -0
- package/dist/chunk-TZRBETT3.js.map +1 -0
- package/dist/{chunk-MF2JDREK.js → chunk-UNVB4INM.js} +1 -1
- package/dist/{chunk-MF2JDREK.js.map → chunk-UNVB4INM.js.map} +1 -1
- package/dist/chunk-VBG3UYQR.js +119 -0
- package/dist/chunk-VBG3UYQR.js.map +1 -0
- package/dist/events/index.js +3 -4
- package/dist/events/server/index.js +3 -4
- package/dist/events/shared/index.js +2 -3
- package/dist/graphql/field/index.cjs +189 -0
- package/dist/graphql/field/index.cjs.map +1 -0
- package/dist/graphql/field/index.d.cts +214 -0
- package/dist/graphql/field/index.d.ts +214 -0
- package/dist/graphql/field/index.js +25 -0
- package/dist/graphql/field/index.js.map +1 -0
- package/dist/graphql/index.cjs +1148 -0
- package/dist/graphql/index.cjs.map +1 -0
- package/dist/graphql/index.d.cts +8 -0
- package/dist/graphql/index.d.ts +8 -0
- package/dist/graphql/index.js +49 -0
- package/dist/graphql/index.js.map +1 -0
- package/dist/graphql/sdl/index.cjs +241 -0
- package/dist/graphql/sdl/index.cjs.map +1 -0
- package/dist/graphql/sdl/index.d.cts +77 -0
- package/dist/graphql/sdl/index.d.ts +77 -0
- package/dist/graphql/sdl/index.js +8 -0
- package/dist/graphql/sdl/index.js.map +1 -0
- package/dist/graphql/server/index.cjs +505 -0
- package/dist/graphql/server/index.cjs.map +1 -0
- package/dist/graphql/server/index.d.cts +268 -0
- package/dist/graphql/server/index.d.ts +268 -0
- package/dist/graphql/server/index.js +15 -0
- package/dist/graphql/server/index.js.map +1 -0
- package/dist/graphql/shared/index.cjs +586 -0
- package/dist/graphql/shared/index.cjs.map +1 -0
- package/dist/graphql/shared/index.d.cts +82 -0
- package/dist/graphql/shared/index.d.ts +82 -0
- package/dist/graphql/shared/index.js +16 -0
- package/dist/graphql/shared/index.js.map +1 -0
- package/dist/http/index.cjs.map +1 -1
- package/dist/http/index.js +2 -3
- package/dist/http/route/index.cjs.map +1 -1
- package/dist/http/route/index.d.cts +4 -0
- package/dist/http/route/index.d.ts +4 -0
- package/dist/http/route/index.js +1 -1
- package/dist/http/shared/index.js +1 -2
- package/dist/index.cjs +672 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +43 -1
- package/dist/index.js.map +1 -1
- package/dist/schema-definition.type-C9PntBVc.d.cts +166 -0
- package/dist/schema-definition.type-CuhQLDr0.d.ts +166 -0
- package/package.json +31 -1
- package/dist/chunk-2BVCU32G.js.map +0 -1
- package/dist/chunk-H5TNDC5U.js +0 -138
- package/dist/chunk-H5TNDC5U.js.map +0 -1
- /package/dist/{chunk-XWKHOLIP.js.map → chunk-4HMXTGHK.js.map} +0 -0
- /package/dist/{chunk-4BVOLXDJ.js.map → chunk-4YBAV6LZ.js.map} +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AccessDeniedError,
|
|
3
|
+
ConflictError,
|
|
4
|
+
DomainError,
|
|
5
|
+
ForbiddenError,
|
|
6
|
+
InfraError,
|
|
7
|
+
NotFoundError,
|
|
8
|
+
UnprocessableError,
|
|
9
|
+
hasValidationErrors,
|
|
10
|
+
isErrorType
|
|
11
|
+
} from "./chunk-HNEAH6OZ.js";
|
|
12
|
+
import {
|
|
13
|
+
UnauthorizedError,
|
|
14
|
+
UseCaseError
|
|
15
|
+
} from "./chunk-T7S574XQ.js";
|
|
16
|
+
import {
|
|
17
|
+
ObjectValidationError
|
|
18
|
+
} from "./chunk-3BY5RBF2.js";
|
|
19
|
+
import {
|
|
20
|
+
CodedError
|
|
21
|
+
} from "./chunk-A4JUAZK4.js";
|
|
22
|
+
|
|
23
|
+
// src/presentation/graphql/shared/error-mapping.ts
|
|
24
|
+
var MASKED_ERROR = {
|
|
25
|
+
message: "An unexpected error occurred",
|
|
26
|
+
extensions: { code: "INTERNAL_ERROR" }
|
|
27
|
+
};
|
|
28
|
+
var INTERNAL_ERROR_TYPES = [
|
|
29
|
+
"DomainError",
|
|
30
|
+
"InfraError",
|
|
31
|
+
"ControllerError",
|
|
32
|
+
"NetworkError",
|
|
33
|
+
"PersistenceError",
|
|
34
|
+
"ExternalServiceError",
|
|
35
|
+
"InvariantViolationError"
|
|
36
|
+
];
|
|
37
|
+
function getGraphQLErrorCode(error) {
|
|
38
|
+
if (error instanceof ObjectValidationError) return "VALIDATION_ERROR";
|
|
39
|
+
if (error instanceof UnauthorizedError) return "FORBIDDEN";
|
|
40
|
+
if (error instanceof ForbiddenError) return "FORBIDDEN";
|
|
41
|
+
if (error instanceof AccessDeniedError) return "FORBIDDEN";
|
|
42
|
+
if (error instanceof NotFoundError) return "NOT_FOUND";
|
|
43
|
+
if (error instanceof ConflictError) return "CONFLICT";
|
|
44
|
+
if (error instanceof UnprocessableError) return "UNPROCESSABLE";
|
|
45
|
+
if (error instanceof UseCaseError) return "BAD_REQUEST";
|
|
46
|
+
if (isErrorType(error, "ObjectValidationError")) return "VALIDATION_ERROR";
|
|
47
|
+
if (isErrorType(error, "UnauthorizedError")) return "FORBIDDEN";
|
|
48
|
+
if (isErrorType(error, "ForbiddenError")) return "FORBIDDEN";
|
|
49
|
+
if (isErrorType(error, "AccessDeniedError")) return "FORBIDDEN";
|
|
50
|
+
if (isErrorType(error, "NotFoundError")) return "NOT_FOUND";
|
|
51
|
+
if (isErrorType(error, "ConflictError")) return "CONFLICT";
|
|
52
|
+
if (isErrorType(error, "UnprocessableError")) return "UNPROCESSABLE";
|
|
53
|
+
if (isErrorType(error, "UseCaseError")) return "BAD_REQUEST";
|
|
54
|
+
return "INTERNAL_ERROR";
|
|
55
|
+
}
|
|
56
|
+
function shouldMaskGraphQLError(error) {
|
|
57
|
+
if (error instanceof DomainError || error instanceof InfraError) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
for (const errorType of INTERNAL_ERROR_TYPES) {
|
|
61
|
+
if (isErrorType(error, errorType)) {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
function mapErrorToGraphQLError(error) {
|
|
68
|
+
if (shouldMaskGraphQLError(error)) {
|
|
69
|
+
return MASKED_ERROR;
|
|
70
|
+
}
|
|
71
|
+
const code = getGraphQLErrorCode(error);
|
|
72
|
+
if (error instanceof ObjectValidationError) {
|
|
73
|
+
return buildValidationError(error.message, code, error.code, error.validationErrors);
|
|
74
|
+
}
|
|
75
|
+
if (isErrorType(error, "ObjectValidationError") && hasValidationErrors(error)) {
|
|
76
|
+
return buildValidationError(error.message, code, error.code, error.validationErrors);
|
|
77
|
+
}
|
|
78
|
+
if (error instanceof CodedError) {
|
|
79
|
+
return {
|
|
80
|
+
message: error.message,
|
|
81
|
+
extensions: { code, originalCode: error.code }
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (isErrorType(error, "CodedError")) {
|
|
85
|
+
return {
|
|
86
|
+
message: error.message,
|
|
87
|
+
extensions: { code, originalCode: error.code }
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
if (error && typeof error === "object" && "message" in error && "code" in error && typeof error.message === "string" && typeof error.code === "string") {
|
|
91
|
+
return {
|
|
92
|
+
message: error.message,
|
|
93
|
+
extensions: { code, originalCode: error.code }
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return MASKED_ERROR;
|
|
97
|
+
}
|
|
98
|
+
function buildValidationError(message, code, originalCode, validationErrors) {
|
|
99
|
+
return {
|
|
100
|
+
message,
|
|
101
|
+
extensions: {
|
|
102
|
+
code,
|
|
103
|
+
originalCode,
|
|
104
|
+
validationErrors: validationErrors.map(
|
|
105
|
+
(e) => ({
|
|
106
|
+
field: e.field,
|
|
107
|
+
message: e.message
|
|
108
|
+
})
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export {
|
|
115
|
+
getGraphQLErrorCode,
|
|
116
|
+
shouldMaskGraphQLError,
|
|
117
|
+
mapErrorToGraphQLError
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=chunk-VBG3UYQR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/presentation/graphql/shared/error-mapping.ts"],"sourcesContent":["/**\n * @fileoverview Centralized error mapping for GraphQL resolvers.\n *\n * Maps onion-lasagna errors to GraphQL error extensions,\n * following the same pattern as the HTTP error mapper.\n *\n * @module graphql/shared/error-mapping\n */\n\nimport { CodedError } from '../../../global/exceptions/coded-error.error';\nimport { ObjectValidationError } from '../../../global/exceptions/object-validation.error';\nimport { DomainError } from '../../../domain/exceptions/domain.error';\nimport { UseCaseError } from '../../../app/exceptions/use-case.error';\nimport { NotFoundError } from '../../../app/exceptions/not-found.error';\nimport { ConflictError } from '../../../app/exceptions/conflict.error';\nimport { UnprocessableError } from '../../../app/exceptions/unprocessable.error';\nimport { ForbiddenError } from '../../../app/exceptions/forbidden.error';\nimport { UnauthorizedError } from '../../../app/exceptions/unauthorized.error';\nimport { InfraError } from '../../../infra/exceptions/infra.error';\nimport { AccessDeniedError } from '../../exceptions/access-denied.error';\nimport { isErrorType, hasValidationErrors } from '../../http/shared/error-mapping';\nimport type { GraphQLErrorCode, MappedGraphQLError, GraphQLValidationErrorItem } from './types';\n\n// ============================================================================\n// Constants\n// ============================================================================\n\n/**\n * Default masked error for internal errors.\n */\nconst MASKED_ERROR: MappedGraphQLError = {\n message: 'An unexpected error occurred',\n extensions: { code: 'INTERNAL_ERROR' },\n};\n\n/**\n * Known internal error type names that should be masked.\n */\nconst INTERNAL_ERROR_TYPES = [\n 'DomainError',\n 'InfraError',\n 'ControllerError',\n 'NetworkError',\n 'PersistenceError',\n 'ExternalServiceError',\n 'InvariantViolationError',\n];\n\n// ============================================================================\n// Extension Code Mapping\n// ============================================================================\n\n/**\n * Gets the GraphQL extension code for an error.\n * Uses instanceof first, then falls back to name-based checking for bundled code.\n */\nexport function getGraphQLErrorCode(error: unknown): GraphQLErrorCode {\n // Try instanceof first (faster)\n if (error instanceof ObjectValidationError) return 'VALIDATION_ERROR';\n if (error instanceof UnauthorizedError) return 'FORBIDDEN';\n if (error instanceof ForbiddenError) return 'FORBIDDEN';\n if (error instanceof AccessDeniedError) return 'FORBIDDEN';\n if (error instanceof NotFoundError) return 'NOT_FOUND';\n if (error instanceof ConflictError) return 'CONFLICT';\n if (error instanceof UnprocessableError) return 'UNPROCESSABLE';\n if (error instanceof UseCaseError) return 'BAD_REQUEST';\n\n // Fall back to name-based checking for bundled code\n if (isErrorType(error, 'ObjectValidationError')) return 'VALIDATION_ERROR';\n if (isErrorType(error, 'UnauthorizedError')) return 'FORBIDDEN';\n if (isErrorType(error, 'ForbiddenError')) return 'FORBIDDEN';\n if (isErrorType(error, 'AccessDeniedError')) return 'FORBIDDEN';\n if (isErrorType(error, 'NotFoundError')) return 'NOT_FOUND';\n if (isErrorType(error, 'ConflictError')) return 'CONFLICT';\n if (isErrorType(error, 'UnprocessableError')) return 'UNPROCESSABLE';\n if (isErrorType(error, 'UseCaseError')) return 'BAD_REQUEST';\n\n return 'INTERNAL_ERROR';\n}\n\n/**\n * Checks if an error should have its details masked.\n *\n * Security-sensitive errors (domain, infrastructure) are masked\n * to prevent leaking implementation details.\n */\nexport function shouldMaskGraphQLError(error: unknown): boolean {\n // Try instanceof first (faster)\n if (error instanceof DomainError || error instanceof InfraError) {\n return true;\n }\n\n // Fall back to name-based checking for bundled code\n for (const errorType of INTERNAL_ERROR_TYPES) {\n if (isErrorType(error, errorType)) {\n return true;\n }\n }\n\n return false;\n}\n\n// ============================================================================\n// Primary Mapping Function\n// ============================================================================\n\n/**\n * Maps an error to a GraphQL error with extensions.\n *\n * Mapping strategy (checked in order):\n * 1. `ObjectValidationError` → `VALIDATION_ERROR` (with field errors)\n * 2. `UnauthorizedError` / `ForbiddenError` / `AccessDeniedError` → `FORBIDDEN`\n * 3. `NotFoundError` → `NOT_FOUND`\n * 4. `ConflictError` → `CONFLICT`\n * 5. `UnprocessableError` → `UNPROCESSABLE`\n * 6. `UseCaseError` → `BAD_REQUEST`\n * 7. `DomainError` / `InfraError` → `INTERNAL_ERROR` (masked)\n * 8. Unknown → `INTERNAL_ERROR` (masked)\n *\n * @param error - The error to map\n * @returns Mapped GraphQL error with message and extensions\n */\nexport function mapErrorToGraphQLError(error: unknown): MappedGraphQLError {\n // Masked errors - hide internal details\n if (shouldMaskGraphQLError(error)) {\n return MASKED_ERROR;\n }\n\n const code = getGraphQLErrorCode(error);\n\n // Validation errors - include field details\n if (error instanceof ObjectValidationError) {\n return buildValidationError(error.message, code, error.code, error.validationErrors);\n }\n\n // Validation errors - fall back to name-based checking for bundled code\n if (isErrorType(error, 'ObjectValidationError') && hasValidationErrors(error)) {\n return buildValidationError(error.message, code, error.code, error.validationErrors);\n }\n\n // Other coded errors - expose message\n if (error instanceof CodedError) {\n return {\n message: error.message,\n extensions: { code, originalCode: error.code },\n };\n }\n\n // Other coded errors - fall back to name-based checking\n if (isErrorType(error, 'CodedError')) {\n return {\n message: error.message,\n extensions: { code, originalCode: error.code },\n };\n }\n\n // Check for any error with message and code properties\n if (\n error &&\n typeof error === 'object' &&\n 'message' in error &&\n 'code' in error &&\n typeof (error as { message: string }).message === 'string' &&\n typeof (error as { code: string }).code === 'string'\n ) {\n return {\n message: (error as { message: string }).message,\n extensions: { code, originalCode: (error as { code: string }).code },\n };\n }\n\n // Unknown errors - mask\n return MASKED_ERROR;\n}\n\n/**\n * Builds a validation error response with field details.\n */\nfunction buildValidationError(\n message: string,\n code: GraphQLErrorCode,\n originalCode: string,\n validationErrors: readonly { field: string; message: string }[],\n): MappedGraphQLError {\n return {\n message,\n extensions: {\n code,\n originalCode,\n validationErrors: validationErrors.map(\n (e): GraphQLValidationErrorItem => ({\n field: e.field,\n message: e.message,\n }),\n ),\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAM,eAAmC;AAAA,EACvC,SAAS;AAAA,EACT,YAAY,EAAE,MAAM,iBAAiB;AACvC;AAKA,IAAM,uBAAuB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAUO,SAAS,oBAAoB,OAAkC;AAEpE,MAAI,iBAAiB,sBAAuB,QAAO;AACnD,MAAI,iBAAiB,kBAAmB,QAAO;AAC/C,MAAI,iBAAiB,eAAgB,QAAO;AAC5C,MAAI,iBAAiB,kBAAmB,QAAO;AAC/C,MAAI,iBAAiB,cAAe,QAAO;AAC3C,MAAI,iBAAiB,cAAe,QAAO;AAC3C,MAAI,iBAAiB,mBAAoB,QAAO;AAChD,MAAI,iBAAiB,aAAc,QAAO;AAG1C,MAAI,YAAY,OAAO,uBAAuB,EAAG,QAAO;AACxD,MAAI,YAAY,OAAO,mBAAmB,EAAG,QAAO;AACpD,MAAI,YAAY,OAAO,gBAAgB,EAAG,QAAO;AACjD,MAAI,YAAY,OAAO,m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Ae,MAA2B,KAAK;AAAA,IACrE;AAAA,EACF;AAGA,SAAO;AACT;AAKA,SAAS,qBACP,SACA,MACA,cACA,kBACoB;AACpB,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,MACV;AAAA,MACA;AAAA,MACA,kBAAkB,iBAAiB;AAAA,QACjC,CAAC,OAAmC;AAAA,UAClC,OAAO,EAAE;AAAA,UACT,SAAS,EAAE;AAAA,QACb;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
package/dist/events/index.js
CHANGED
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
eventRoutes,
|
|
8
8
|
isSimpleEventHandlerConfig
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-4HMXTGHK.js";
|
|
10
10
|
import "../chunk-RVSBIYY4.js";
|
|
11
11
|
import {
|
|
12
12
|
mapErrorToEventResult
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-4YBAV6LZ.js";
|
|
14
14
|
import {
|
|
15
15
|
generateAsyncAPI
|
|
16
16
|
} from "../chunk-KJ4JGZOE.js";
|
|
@@ -20,8 +20,7 @@ import {
|
|
|
20
20
|
isEventHandlerDefinition,
|
|
21
21
|
isEventRouterDefinition
|
|
22
22
|
} from "../chunk-CBTICRSM.js";
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-2BVCU32G.js";
|
|
23
|
+
import "../chunk-HNEAH6OZ.js";
|
|
25
24
|
import "../chunk-T7S574XQ.js";
|
|
26
25
|
import "../chunk-3BY5RBF2.js";
|
|
27
26
|
import "../chunk-A4JUAZK4.js";
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
eventRoutes,
|
|
3
3
|
isSimpleEventHandlerConfig
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-4HMXTGHK.js";
|
|
5
|
+
import "../../chunk-4YBAV6LZ.js";
|
|
6
6
|
import "../../chunk-CBTICRSM.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-2BVCU32G.js";
|
|
7
|
+
import "../../chunk-HNEAH6OZ.js";
|
|
9
8
|
import "../../chunk-T7S574XQ.js";
|
|
10
9
|
import "../../chunk-3BY5RBF2.js";
|
|
11
10
|
import "../../chunk-A4JUAZK4.js";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import "../../chunk-RVSBIYY4.js";
|
|
2
2
|
import {
|
|
3
3
|
mapErrorToEventResult
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-2BVCU32G.js";
|
|
4
|
+
} from "../../chunk-4YBAV6LZ.js";
|
|
5
|
+
import "../../chunk-HNEAH6OZ.js";
|
|
7
6
|
import "../../chunk-T7S574XQ.js";
|
|
8
7
|
import "../../chunk-3BY5RBF2.js";
|
|
9
8
|
import "../../chunk-A4JUAZK4.js";
|
|
@@ -0,0 +1,189 @@
|
|
|
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
|
+
|
|
20
|
+
// src/presentation/graphql/field/index.ts
|
|
21
|
+
var field_exports = {};
|
|
22
|
+
__export(field_exports, {
|
|
23
|
+
collectFields: () => collectFields,
|
|
24
|
+
defineGraphQLSchema: () => defineGraphQLSchema,
|
|
25
|
+
defineMutation: () => defineMutation,
|
|
26
|
+
defineQuery: () => defineQuery,
|
|
27
|
+
defineSubscription: () => defineSubscription,
|
|
28
|
+
generateFieldId: () => generateFieldId,
|
|
29
|
+
isFieldDefinition: () => isFieldDefinition,
|
|
30
|
+
isSchemaDefinition: () => isSchemaDefinition,
|
|
31
|
+
mergeGraphQLSchemas: () => mergeGraphQLSchemas
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(field_exports);
|
|
34
|
+
|
|
35
|
+
// src/presentation/graphql/field/define-field.ts
|
|
36
|
+
function createFieldDefinition(operation, input) {
|
|
37
|
+
const definition = {
|
|
38
|
+
operation,
|
|
39
|
+
input: input.input ?? void 0,
|
|
40
|
+
output: input.output ?? void 0,
|
|
41
|
+
context: input.context ?? void 0,
|
|
42
|
+
docs: {
|
|
43
|
+
summary: input.docs?.summary,
|
|
44
|
+
description: input.docs?.description,
|
|
45
|
+
tags: input.docs?.tags,
|
|
46
|
+
deprecated: input.docs?.deprecated ?? false,
|
|
47
|
+
deprecationReason: input.docs?.deprecationReason
|
|
48
|
+
},
|
|
49
|
+
_isGraphQLField: true,
|
|
50
|
+
_types: void 0
|
|
51
|
+
};
|
|
52
|
+
return Object.freeze(definition);
|
|
53
|
+
}
|
|
54
|
+
function defineQuery(config = {}) {
|
|
55
|
+
return createFieldDefinition("query", config);
|
|
56
|
+
}
|
|
57
|
+
function defineMutation(config = {}) {
|
|
58
|
+
return createFieldDefinition("mutation", config);
|
|
59
|
+
}
|
|
60
|
+
function defineSubscription(config = {}) {
|
|
61
|
+
return createFieldDefinition("subscription", config);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// src/presentation/graphql/field/types/schema-definition.type.ts
|
|
65
|
+
function isFieldDefinition(value) {
|
|
66
|
+
return typeof value === "object" && value !== null && "_isGraphQLField" in value && value._isGraphQLField === true;
|
|
67
|
+
}
|
|
68
|
+
function isSchemaDefinition(value) {
|
|
69
|
+
return typeof value === "object" && value !== null && "_isGraphQLSchema" in value && value._isGraphQLSchema === true;
|
|
70
|
+
}
|
|
71
|
+
function collectFields(config, basePath = "") {
|
|
72
|
+
const fields = [];
|
|
73
|
+
for (const [key, value] of Object.entries(config)) {
|
|
74
|
+
const fullKey = basePath ? `${basePath}.${key}` : key;
|
|
75
|
+
if (isFieldDefinition(value)) {
|
|
76
|
+
fields.push({ key: fullKey, field: value });
|
|
77
|
+
} else if (isSchemaDefinition(value)) {
|
|
78
|
+
fields.push(...collectFields(value.fields, fullKey));
|
|
79
|
+
} else if (typeof value === "object" && value !== null) {
|
|
80
|
+
fields.push(...collectFields(value, fullKey));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return fields;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// src/presentation/graphql/field/define-schema.ts
|
|
87
|
+
function defineGraphQLSchema(fields, options) {
|
|
88
|
+
const defaults = options?.defaults;
|
|
89
|
+
const processedFields = defaults?.context || defaults?.tags ? applySchemaDefaults(fields, defaults) : fields;
|
|
90
|
+
const definition = {
|
|
91
|
+
fields: processedFields,
|
|
92
|
+
defaults,
|
|
93
|
+
_isGraphQLSchema: true
|
|
94
|
+
};
|
|
95
|
+
return deepFreeze(definition);
|
|
96
|
+
}
|
|
97
|
+
function applySchemaDefaults(config, defaults) {
|
|
98
|
+
const result = {};
|
|
99
|
+
for (const [key, value] of Object.entries(config)) {
|
|
100
|
+
if (isFieldDefinition(value)) {
|
|
101
|
+
result[key] = applyDefaultsToField(value, defaults);
|
|
102
|
+
} else if (isSchemaDefinition(value)) {
|
|
103
|
+
result[key] = {
|
|
104
|
+
...value,
|
|
105
|
+
fields: applySchemaDefaults(value.fields, defaults)
|
|
106
|
+
};
|
|
107
|
+
} else if (typeof value === "object" && value !== null) {
|
|
108
|
+
result[key] = applySchemaDefaults(value, defaults);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
function applyDefaultsToField(field, defaults) {
|
|
114
|
+
const needsContext = defaults.context && !field.context;
|
|
115
|
+
const needsTags = defaults.tags && defaults.tags.length > 0;
|
|
116
|
+
if (!needsContext && !needsTags) return field;
|
|
117
|
+
return Object.freeze({
|
|
118
|
+
...field,
|
|
119
|
+
context: field.context ?? defaults.context ?? void 0,
|
|
120
|
+
docs: {
|
|
121
|
+
...field.docs,
|
|
122
|
+
tags: mergeTags(defaults.tags, field.docs.tags)
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function mergeTags(schemaTags, fieldTags) {
|
|
127
|
+
if (!schemaTags || schemaTags.length === 0) return fieldTags;
|
|
128
|
+
if (!fieldTags || fieldTags.length === 0) return schemaTags;
|
|
129
|
+
const merged = [...schemaTags];
|
|
130
|
+
for (const tag of fieldTags) {
|
|
131
|
+
if (!merged.includes(tag)) {
|
|
132
|
+
merged.push(tag);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return merged;
|
|
136
|
+
}
|
|
137
|
+
function deepFreeze(obj) {
|
|
138
|
+
const propNames = Object.getOwnPropertyNames(obj);
|
|
139
|
+
for (const name of propNames) {
|
|
140
|
+
const value = obj[name];
|
|
141
|
+
if (value && typeof value === "object" && !Object.isFrozen(value)) {
|
|
142
|
+
deepFreeze(value);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return Object.freeze(obj);
|
|
146
|
+
}
|
|
147
|
+
function extractFields(input) {
|
|
148
|
+
return isSchemaDefinition(input) ? input.fields : input;
|
|
149
|
+
}
|
|
150
|
+
function isSubGroup(value) {
|
|
151
|
+
return typeof value === "object" && value !== null && !isFieldDefinition(value) && !isSchemaDefinition(value);
|
|
152
|
+
}
|
|
153
|
+
function deepMergeConfigs(a, b) {
|
|
154
|
+
const result = { ...a };
|
|
155
|
+
for (const key of Object.keys(b)) {
|
|
156
|
+
const aVal = result[key];
|
|
157
|
+
const bVal = b[key];
|
|
158
|
+
if (isSubGroup(aVal) && isSubGroup(bVal)) {
|
|
159
|
+
result[key] = deepMergeConfigs(aVal, bVal);
|
|
160
|
+
} else {
|
|
161
|
+
result[key] = bVal;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return result;
|
|
165
|
+
}
|
|
166
|
+
function mergeGraphQLSchemas(...schemas) {
|
|
167
|
+
const merged = schemas.map(extractFields).reduce(deepMergeConfigs);
|
|
168
|
+
return defineGraphQLSchema(merged);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// src/presentation/graphql/field/utils.ts
|
|
172
|
+
function generateFieldId(key) {
|
|
173
|
+
return key.split(".").map(
|
|
174
|
+
(segment, index) => index === 0 ? segment : segment.charAt(0).toUpperCase() + segment.slice(1)
|
|
175
|
+
).join("");
|
|
176
|
+
}
|
|
177
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
178
|
+
0 && (module.exports = {
|
|
179
|
+
collectFields,
|
|
180
|
+
defineGraphQLSchema,
|
|
181
|
+
defineMutation,
|
|
182
|
+
defineQuery,
|
|
183
|
+
defineSubscription,
|
|
184
|
+
generateFieldId,
|
|
185
|
+
isFieldDefinition,
|
|
186
|
+
isSchemaDefinition,
|
|
187
|
+
mergeGraphQLSchemas
|
|
188
|
+
});
|
|
189
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/presentation/graphql/field/index.ts","../../../src/presentation/graphql/field/define-field.ts","../../../src/presentation/graphql/field/types/schema-definition.type.ts","../../../src/presentation/graphql/field/define-schema.ts","../../../src/presentation/graphql/field/utils.ts"],"sourcesContent":["export { defineQuery, defineMutation, defineSubscription } from './define-field';\nexport { defineGraphQLSchema, mergeGraphQLSchemas } from './define-schema';\nexport type { DefineGraphQLSchemaOptions } from './define-schema';\nexport { generateFieldId } from './utils';\nexport * from './types';\n","/**\n * @fileoverview Factory functions for creating GraphQL field definitions.\n *\n * `defineQuery`, `defineMutation`, and `defineSubscription` are the main entry\n * points for defining GraphQL fields. They mirror `defineRoute` /\n * `defineEventHandler` from the HTTP and event layers.\n *\n * @module graphql/field/define-field\n */\n\nimport type { SchemaAdapter, InferOutput } from '../../http/schema/types';\nimport type { GraphQLFieldDefinition, GraphQLOperationType } from './types';\n\n// ============================================================================\n// Input Types\n// ============================================================================\n\n/**\n * Input for defineQuery / defineMutation.\n *\n * @example Query with input and output\n * ```typescript\n * defineQuery({\n * input: zodSchema(z.object({ userId: z.string() })),\n * output: zodSchema(userSchema),\n * docs: { description: 'Get a user by ID' },\n * })\n * ```\n *\n * @example Mutation with context\n * ```typescript\n * defineMutation({\n * input: zodSchema(z.object({ name: z.string() })),\n * output: zodSchema(z.object({ id: z.string() })),\n * context: zodSchema(executionContextSchema),\n * docs: { description: 'Create a project' },\n * })\n * ```\n */\ninterface DefineFieldInput<\n TInput extends SchemaAdapter | undefined = undefined,\n TOutput extends SchemaAdapter | undefined = undefined,\n TContext extends SchemaAdapter | undefined = undefined,\n> {\n /** Input arguments validation schema. */\n readonly input?: TInput;\n\n /** Output type validation schema. */\n readonly output?: TOutput;\n\n /** Context validation schema (e.g., JWT payload from middleware). */\n readonly context?: TContext;\n\n /** Field documentation. */\n readonly docs?: {\n readonly summary?: string;\n readonly description?: string;\n readonly tags?: readonly string[];\n readonly deprecated?: boolean;\n readonly deprecationReason?: string;\n };\n}\n\n// ============================================================================\n// Return type helpers\n// ============================================================================\n\ntype ResolveInput<T> = T extends SchemaAdapter ? InferOutput<T> : undefined;\ntype ResolveOutput<T> = T extends SchemaAdapter ? InferOutput<T> : undefined;\ntype ResolveContext<T> = T extends SchemaAdapter ? InferOutput<T> : undefined;\n\n// ============================================================================\n// Internal Factory\n// ============================================================================\n\nfunction createFieldDefinition<\n TOperation extends GraphQLOperationType,\n TInput extends SchemaAdapter | undefined = undefined,\n TOutput extends SchemaAdapter | undefined = undefined,\n TContext extends SchemaAdapter | undefined = undefined,\n>(\n operation: TOperation,\n input: DefineFieldInput<TInput, TOutput, TContext>,\n): GraphQLFieldDefinition<\n TOperation,\n ResolveInput<TInput>,\n ResolveOutput<TOutput>,\n ResolveContext<TContext>\n> {\n const definition = {\n operation,\n input: input.input ?? undefined,\n output: input.output ?? undefined,\n context: input.context ?? undefined,\n docs: {\n summary: input.docs?.summary,\n description: input.docs?.description,\n tags: input.docs?.tags,\n deprecated: input.docs?.deprecated ?? false,\n deprecationReason: input.docs?.deprecationReason,\n },\n _isGraphQLField: true as const,\n _types: undefined as unknown,\n };\n\n return Object.freeze(definition) as GraphQLFieldDefinition<\n TOperation,\n ResolveInput<TInput>,\n ResolveOutput<TOutput>,\n ResolveContext<TContext>\n >;\n}\n\n// ============================================================================\n// Public API\n// ============================================================================\n\n/**\n * Creates a GraphQL query field definition.\n *\n * @param config - Field configuration with optional schemas\n * @returns A frozen GraphQLFieldDefinition with operation 'query'\n *\n * @example\n * ```typescript\n * const getUser = defineQuery({\n * input: zodSchema(z.object({ userId: z.string() })),\n * output: zodSchema(userSchema),\n * docs: { description: 'Get a user by ID' },\n * });\n * ```\n */\nexport function defineQuery<\n TInput extends SchemaAdapter | undefined = undefined,\n TOutput extends SchemaAdapter | undefined = undefined,\n TContext extends SchemaAdapter | undefined = undefined,\n>(\n config: DefineFieldInput<TInput, TOutput, TContext> = {},\n): GraphQLFieldDefinition<\n 'query',\n ResolveInput<TInput>,\n ResolveOutput<TOutput>,\n ResolveContext<TContext>\n> {\n return createFieldDefinition('query', config);\n}\n\n/**\n * Creates a GraphQL mutation field definition.\n *\n * @param config - Field configuration with optional schemas\n * @returns A frozen GraphQLFieldDefinition with operation 'mutation'\n *\n * @example\n * ```typescript\n * const createProject = defineMutation({\n * input: zodSchema(z.object({ name: z.string() })),\n * output: zodSchema(z.object({ id: z.string() })),\n * context: zodSchema(executionContextSchema),\n * docs: { description: 'Create a new project' },\n * });\n * ```\n */\nexport function defineMutation<\n TInput extends SchemaAdapter | undefined = undefined,\n TOutput extends SchemaAdapter | undefined = undefined,\n TContext extends SchemaAdapter | undefined = undefined,\n>(\n config: DefineFieldInput<TInput, TOutput, TContext> = {},\n): GraphQLFieldDefinition<\n 'mutation',\n ResolveInput<TInput>,\n ResolveOutput<TOutput>,\n ResolveContext<TContext>\n> {\n return createFieldDefinition('mutation', config);\n}\n\n/**\n * Creates a GraphQL subscription field definition.\n *\n * Subscription handlers return an `AsyncIterable` of values rather than\n * a single response. The output schema validates each emitted value.\n *\n * @param config - Field configuration with optional schemas\n * @returns A frozen GraphQLFieldDefinition with operation 'subscription'\n *\n * @example\n * ```typescript\n * const onTicketCreated = defineSubscription({\n * input: zodSchema(z.object({ projectId: z.string() })),\n * output: zodSchema(ticketSchema),\n * docs: { description: 'Subscribe to new tickets in a project' },\n * });\n * ```\n */\nexport function defineSubscription<\n TInput extends SchemaAdapter | undefined = undefined,\n TOutput extends SchemaAdapter | undefined = undefined,\n TContext extends SchemaAdapter | undefined = undefined,\n>(\n config: DefineFieldInput<TInput, TOutput, TContext> = {},\n): GraphQLFieldDefinition<\n 'subscription',\n ResolveInput<TInput>,\n ResolveOutput<TOutput>,\n ResolveContext<TContext>\n> {\n return createFieldDefinition('subscription', config);\n}\n","/**\n * @fileoverview GraphQL schema definition types for grouping fields.\n *\n * Mirrors the HTTP router definition pattern with hierarchical grouping,\n * dotted-key access, and deep merge support.\n *\n * @module graphql/field/types/schema-definition\n */\n\nimport type { GraphQLFieldDefinition, GraphQLOperationType } from './field-definition.type';\nimport type { SchemaAdapter } from '../../../http/schema/types';\n\n// ============================================================================\n// Schema Types\n// ============================================================================\n\n/**\n * A schema entry can be a field definition, a nested config, or a schema definition.\n */\nexport type GraphQLSchemaEntry =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | GraphQLFieldDefinition<GraphQLOperationType, any, any, any>\n | GraphQLSchemaConfig\n | GraphQLSchemaDefinition;\n\n/**\n * Configuration for a GraphQL schema (group of fields).\n */\nexport interface GraphQLSchemaConfig {\n readonly [key: string]: GraphQLSchemaEntry;\n}\n\n/**\n * Schema-level defaults applied to all child fields.\n */\nexport interface GraphQLSchemaDefaults {\n /** Default tags for all fields. Merged with field-specific tags. */\n readonly tags?: readonly string[];\n\n /** Default context schema. Applied to fields that don't define their own. */\n readonly context?: SchemaAdapter;\n}\n\n/**\n * A fully defined GraphQL schema.\n */\nexport interface GraphQLSchemaDefinition<T extends GraphQLSchemaConfig = GraphQLSchemaConfig> {\n /** The fields and nested groups in this schema. */\n readonly fields: T;\n\n /** Default values applied to all child fields. */\n readonly defaults?: GraphQLSchemaDefaults;\n\n /**\n * Marker to identify this as a GraphQL schema definition.\n * @internal\n */\n readonly _isGraphQLSchema: true;\n}\n\n// ============================================================================\n// Type Guards\n// ============================================================================\n\n/**\n * Checks if a value is a GraphQLFieldDefinition.\n */\nexport function isFieldDefinition(value: unknown): value is GraphQLFieldDefinition {\n return (\n typeof value === 'object' &&\n value !== null &&\n '_isGraphQLField' in value &&\n (value as GraphQLFieldDefinition)._isGraphQLField === true\n );\n}\n\n/**\n * Checks if a value is a GraphQLSchemaDefinition.\n */\nexport function isSchemaDefinition(value: unknown): value is GraphQLSchemaDefinition {\n return (\n typeof value === 'object' &&\n value !== null &&\n '_isGraphQLSchema' in value &&\n (value as GraphQLSchemaDefinition)._isGraphQLSchema === true\n );\n}\n\n// ============================================================================\n// Utility Types\n// ============================================================================\n\n/**\n * Flattens a schema into a map of dotted keys to field definitions.\n */\nexport type FlattenSchema<\n T extends GraphQLSchemaConfig,\n Prefix extends string = '',\n> = T extends GraphQLSchemaConfig\n ? {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [K in keyof T]: T[K] extends GraphQLFieldDefinition<any, any, any, any>\n ? { [P in `${Prefix}${K & string}`]: T[K] }\n : T[K] extends GraphQLSchemaConfig\n ? FlattenSchema<T[K], `${Prefix}${K & string}.`>\n : never;\n }[keyof T] extends infer U\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n U extends Record<string, GraphQLFieldDefinition<any, any, any, any>>\n ? U\n : never\n : never\n : never;\n\n/**\n * Gets all field keys from a schema.\n */\nexport type SchemaKeys<\n T extends GraphQLSchemaConfig,\n Prefix extends string = '',\n> = T extends GraphQLSchemaConfig\n ? {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [K in keyof T]: T[K] extends GraphQLFieldDefinition<any, any, any, any>\n ? `${Prefix}${K & string}`\n : T[K] extends GraphQLSchemaConfig\n ? SchemaKeys<T[K], `${Prefix}${K & string}.`>\n : never;\n }[keyof T]\n : never;\n\n/**\n * Gets a field by its dotted key path.\n */\nexport type GetField<\n T extends GraphQLSchemaConfig,\n K extends string,\n> = K extends `${infer Head}.${infer Tail}`\n ? Head extends keyof T\n ? T[Head] extends GraphQLSchemaConfig\n ? GetField<T[Head], Tail>\n : never\n : never\n : K extends keyof T\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T[K] extends GraphQLFieldDefinition<any, any, any, any>\n ? T[K]\n : never\n : never;\n\n// ============================================================================\n// Deep Merge Types\n// ============================================================================\n\n/**\n * Deep-merges two schema configs at the type level.\n */\nexport type DeepMergeSchemas<A extends GraphQLSchemaConfig, B extends GraphQLSchemaConfig> = {\n readonly [K in keyof A | keyof B]: K extends keyof A\n ? K extends keyof B\n ? A[K] extends GraphQLSchemaConfig\n ? B[K] extends GraphQLSchemaConfig\n ? DeepMergeSchemas<A[K], B[K]>\n : B[K]\n : B[K]\n : A[K]\n : K extends keyof B\n ? B[K]\n : never;\n};\n\n/**\n * Recursively deep-merges N schema configs left-to-right.\n */\nexport type DeepMergeSchemasAll<T extends readonly GraphQLSchemaConfig[]> = T extends readonly [\n infer Only extends GraphQLSchemaConfig,\n]\n ? Only\n : T extends readonly [\n infer First extends GraphQLSchemaConfig,\n infer Second extends GraphQLSchemaConfig,\n ...infer Rest extends readonly GraphQLSchemaConfig[],\n ]\n ? DeepMergeSchemasAll<[DeepMergeSchemas<First, Second>, ...Rest]>\n : GraphQLSchemaConfig;\n\n// ============================================================================\n// Runtime Utilities\n// ============================================================================\n\n/**\n * Collects all fields from a schema into a flat array.\n */\nexport function collectFields(\n config: GraphQLSchemaConfig,\n basePath = '',\n): { key: string; field: GraphQLFieldDefinition }[] {\n const fields: { key: string; field: GraphQLFieldDefinition }[] = [];\n\n for (const [key, value] of Object.entries(config)) {\n const fullKey = basePath ? `${basePath}.${key}` : key;\n\n if (isFieldDefinition(value)) {\n fields.push({ key: fullKey, field: value });\n } else if (isSchemaDefinition(value)) {\n fields.push(...collectFields(value.fields, fullKey));\n } else if (typeof value === 'object' && value !== null) {\n fields.push(...collectFields(value as GraphQLSchemaConfig, fullKey));\n }\n }\n\n return fields;\n}\n","/**\n * @fileoverview Factory function for creating GraphQL schema definitions.\n *\n * The `defineGraphQLSchema` function groups fields into a hierarchical structure\n * with optional schema-level defaults for context and tags.\n *\n * @module graphql/field/define-schema\n */\n\nimport type {\n GraphQLSchemaConfig,\n GraphQLSchemaDefaults,\n GraphQLSchemaDefinition,\n GraphQLFieldDefinition,\n DeepMergeSchemas,\n DeepMergeSchemasAll,\n} from './types';\nimport { isFieldDefinition, isSchemaDefinition } from './types';\n\n/**\n * Options for schema definition.\n */\nexport interface DefineGraphQLSchemaOptions {\n /**\n * Default values applied to all child fields.\n *\n * @example\n * ```typescript\n * defineGraphQLSchema({\n * getUser: getUserQuery,\n * createUser: createUserMutation,\n * }, {\n * defaults: {\n * context: zodSchema(executionContextSchema),\n * tags: ['Users'],\n * },\n * })\n * ```\n */\n readonly defaults?: GraphQLSchemaDefaults;\n}\n\n/**\n * Creates a GraphQL schema definition from a configuration object.\n *\n * A schema is a hierarchical grouping of fields that provides:\n * - Organized API structure with nested namespaces\n * - Type-safe resolver registration\n * - Schema-level defaults for context and tags\n *\n * @param fields - Object containing fields and nested groups\n * @param options - Optional schema configuration\n * @returns A frozen GraphQLSchemaDefinition object\n *\n * @example Basic schema\n * ```typescript\n * const schema = defineGraphQLSchema({\n * users: {\n * get: getUserQuery,\n * list: listUsersQuery,\n * create: createUserMutation,\n * },\n * });\n * ```\n *\n * @example With defaults\n * ```typescript\n * const schema = defineGraphQLSchema({\n * get: getUserQuery,\n * list: listUsersQuery,\n * }, {\n * defaults: {\n * context: zodSchema(executionContextSchema),\n * tags: ['Users'],\n * },\n * });\n * ```\n */\nexport function defineGraphQLSchema<T extends GraphQLSchemaConfig>(\n fields: T,\n options?: DefineGraphQLSchemaOptions,\n): GraphQLSchemaDefinition<T> {\n const defaults = options?.defaults;\n\n // Apply defaults to fields if context or tags are provided\n const processedFields =\n defaults?.context || defaults?.tags ? (applySchemaDefaults(fields, defaults) as T) : fields;\n\n const definition: GraphQLSchemaDefinition<T> = {\n fields: processedFields,\n defaults,\n _isGraphQLSchema: true,\n };\n\n return deepFreeze(definition);\n}\n\n/**\n * Recursively applies schema-level defaults to all fields in the tree.\n */\nfunction applySchemaDefaults(\n config: GraphQLSchemaConfig,\n defaults: GraphQLSchemaDefaults,\n): GraphQLSchemaConfig {\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(config)) {\n if (isFieldDefinition(value)) {\n result[key] = applyDefaultsToField(value, defaults);\n } else if (isSchemaDefinition(value)) {\n result[key] = {\n ...value,\n fields: applySchemaDefaults(value.fields, defaults),\n };\n } else if (typeof value === 'object' && value !== null) {\n result[key] = applySchemaDefaults(value as GraphQLSchemaConfig, defaults);\n }\n }\n\n return result as GraphQLSchemaConfig;\n}\n\n/**\n * Applies schema-level defaults to a single field definition.\n */\nfunction applyDefaultsToField(\n field: GraphQLFieldDefinition,\n defaults: GraphQLSchemaDefaults,\n): GraphQLFieldDefinition {\n const needsContext = defaults.context && !field.context;\n const needsTags = defaults.tags && defaults.tags.length > 0;\n\n if (!needsContext && !needsTags) return field;\n\n return Object.freeze({\n ...field,\n context: field.context ?? defaults.context ?? undefined,\n docs: {\n ...field.docs,\n tags: mergeTags(defaults.tags, field.docs.tags),\n },\n }) as GraphQLFieldDefinition;\n}\n\n/**\n * Merges schema-level tags with field-level tags, avoiding duplicates.\n */\nfunction mergeTags(\n schemaTags?: readonly string[],\n fieldTags?: readonly string[],\n): readonly string[] | undefined {\n if (!schemaTags || schemaTags.length === 0) return fieldTags;\n if (!fieldTags || fieldTags.length === 0) return schemaTags;\n\n const merged = [...schemaTags];\n for (const tag of fieldTags) {\n if (!merged.includes(tag)) {\n merged.push(tag);\n }\n }\n return merged;\n}\n\n/**\n * Deep freezes an object and all its nested objects.\n */\nfunction deepFreeze<T extends object>(obj: T): T {\n const propNames = Object.getOwnPropertyNames(obj) as (keyof T)[];\n\n for (const name of propNames) {\n const value = obj[name];\n if (value && typeof value === 'object' && !Object.isFrozen(value)) {\n deepFreeze(value);\n }\n }\n\n return Object.freeze(obj);\n}\n\n// ============================================================================\n// mergeGraphQLSchemas — variadic deep merge\n// ============================================================================\n\ntype SchemaInput<T extends GraphQLSchemaConfig> = T | GraphQLSchemaDefinition<T>;\n\n/** Extracts the raw GraphQLSchemaConfig from either a plain config or a GraphQLSchemaDefinition. */\nfunction extractFields<T extends GraphQLSchemaConfig>(input: SchemaInput<T>): T {\n return isSchemaDefinition(input) ? input.fields : input;\n}\n\n/** Returns true if `value` is a plain sub-group object (not a FieldDefinition, not a SchemaDefinition). */\nfunction isSubGroup(value: unknown): value is GraphQLSchemaConfig {\n return (\n typeof value === 'object' &&\n value !== null &&\n !isFieldDefinition(value) &&\n !isSchemaDefinition(value)\n );\n}\n\n/** Recursively deep-merges two schema configs. Sub-groups are merged; leaves are overwritten. */\nfunction deepMergeConfigs(a: GraphQLSchemaConfig, b: GraphQLSchemaConfig): GraphQLSchemaConfig {\n const result: Record<string, unknown> = { ...a };\n\n for (const key of Object.keys(b)) {\n const aVal = result[key];\n const bVal = b[key];\n\n if (isSubGroup(aVal) && isSubGroup(bVal)) {\n result[key] = deepMergeConfigs(aVal, bVal);\n } else {\n result[key] = bVal;\n }\n }\n\n return result as GraphQLSchemaConfig;\n}\n\n// Overloads for 2–8 schemas (clean IDE experience)\nexport function mergeGraphQLSchemas<T1 extends GraphQLSchemaConfig, T2 extends GraphQLSchemaConfig>(\n s1: SchemaInput<T1>,\n s2: SchemaInput<T2>,\n): GraphQLSchemaDefinition<DeepMergeSchemas<T1, T2>>;\nexport function mergeGraphQLSchemas<\n T1 extends GraphQLSchemaConfig,\n T2 extends GraphQLSchemaConfig,\n T3 extends GraphQLSchemaConfig,\n>(\n s1: SchemaInput<T1>,\n s2: SchemaInput<T2>,\n s3: SchemaInput<T3>,\n): GraphQLSchemaDefinition<DeepMergeSchemasAll<[T1, T2, T3]>>;\nexport function mergeGraphQLSchemas<\n T1 extends GraphQLSchemaConfig,\n T2 extends GraphQLSchemaConfig,\n T3 extends GraphQLSchemaConfig,\n T4 extends GraphQLSchemaConfig,\n>(\n s1: SchemaInput<T1>,\n s2: SchemaInput<T2>,\n s3: SchemaInput<T3>,\n s4: SchemaInput<T4>,\n): GraphQLSchemaDefinition<DeepMergeSchemasAll<[T1, T2, T3, T4]>>;\nexport function mergeGraphQLSchemas<\n T1 extends GraphQLSchemaConfig,\n T2 extends GraphQLSchemaConfig,\n T3 extends GraphQLSchemaConfig,\n T4 extends GraphQLSchemaConfig,\n T5 extends GraphQLSchemaConfig,\n>(\n s1: SchemaInput<T1>,\n s2: SchemaInput<T2>,\n s3: SchemaInput<T3>,\n s4: SchemaInput<T4>,\n s5: SchemaInput<T5>,\n): GraphQLSchemaDefinition<DeepMergeSchemasAll<[T1, T2, T3, T4, T5]>>;\nexport function mergeGraphQLSchemas<\n T1 extends GraphQLSchemaConfig,\n T2 extends GraphQLSchemaConfig,\n T3 extends GraphQLSchemaConfig,\n T4 extends GraphQLSchemaConfig,\n T5 extends GraphQLSchemaConfig,\n T6 extends GraphQLSchemaConfig,\n>(\n s1: SchemaInput<T1>,\n s2: SchemaInput<T2>,\n s3: SchemaInput<T3>,\n s4: SchemaInput<T4>,\n s5: SchemaInput<T5>,\n s6: SchemaInput<T6>,\n): GraphQLSchemaDefinition<DeepMergeSchemasAll<[T1, T2, T3, T4, T5, T6]>>;\nexport function mergeGraphQLSchemas<\n T1 extends GraphQLSchemaConfig,\n T2 extends GraphQLSchemaConfig,\n T3 extends GraphQLSchemaConfig,\n T4 extends GraphQLSchemaConfig,\n T5 extends GraphQLSchemaConfig,\n T6 extends GraphQLSchemaConfig,\n T7 extends GraphQLSchemaConfig,\n>(\n s1: SchemaInput<T1>,\n s2: SchemaInput<T2>,\n s3: SchemaInput<T3>,\n s4: SchemaInput<T4>,\n s5: SchemaInput<T5>,\n s6: SchemaInput<T6>,\n s7: SchemaInput<T7>,\n): GraphQLSchemaDefinition<DeepMergeSchemasAll<[T1, T2, T3, T4, T5, T6, T7]>>;\nexport function mergeGraphQLSchemas<\n T1 extends GraphQLSchemaConfig,\n T2 extends GraphQLSchemaConfig,\n T3 extends GraphQLSchemaConfig,\n T4 extends GraphQLSchemaConfig,\n T5 extends GraphQLSchemaConfig,\n T6 extends GraphQLSchemaConfig,\n T7 extends GraphQLSchemaConfig,\n T8 extends GraphQLSchemaConfig,\n>(\n s1: SchemaInput<T1>,\n s2: SchemaInput<T2>,\n s3: SchemaInput<T3>,\n s4: SchemaInput<T4>,\n s5: SchemaInput<T5>,\n s6: SchemaInput<T6>,\n s7: SchemaInput<T7>,\n s8: SchemaInput<T8>,\n): GraphQLSchemaDefinition<DeepMergeSchemasAll<[T1, T2, T3, T4, T5, T6, T7, T8]>>;\n// Add overloads for 9-12 following the same pattern as define-router.ts\nexport function mergeGraphQLSchemas<\n T1 extends GraphQLSchemaConfig,\n T2 extends GraphQLSchemaConfig,\n T3 extends GraphQLSchemaConfig,\n T4 extends GraphQLSchemaConfig,\n T5 extends GraphQLSchemaConfig,\n T6 extends GraphQLSchemaConfig,\n T7 extends GraphQLSchemaConfig,\n T8 extends GraphQLSchemaConfig,\n T9 extends GraphQLSchemaConfig,\n>(\n s1: SchemaInput<T1>,\n s2: SchemaInput<T2>,\n s3: SchemaInput<T3>,\n s4: SchemaInput<T4>,\n s5: SchemaInput<T5>,\n s6: SchemaInput<T6>,\n s7: SchemaInput<T7>,\n s8: SchemaInput<T8>,\n s9: SchemaInput<T9>,\n): GraphQLSchemaDefinition<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<DeepMergeSchemas<DeepMergeSchemas<T1, T2>, T3>, T4>,\n T5\n >,\n T6\n >,\n T7\n >,\n T8\n >,\n T9\n >\n>;\nexport function mergeGraphQLSchemas<\n T1 extends GraphQLSchemaConfig,\n T2 extends GraphQLSchemaConfig,\n T3 extends GraphQLSchemaConfig,\n T4 extends GraphQLSchemaConfig,\n T5 extends GraphQLSchemaConfig,\n T6 extends GraphQLSchemaConfig,\n T7 extends GraphQLSchemaConfig,\n T8 extends GraphQLSchemaConfig,\n T9 extends GraphQLSchemaConfig,\n T10 extends GraphQLSchemaConfig,\n>(\n s1: SchemaInput<T1>,\n s2: SchemaInput<T2>,\n s3: SchemaInput<T3>,\n s4: SchemaInput<T4>,\n s5: SchemaInput<T5>,\n s6: SchemaInput<T6>,\n s7: SchemaInput<T7>,\n s8: SchemaInput<T8>,\n s9: SchemaInput<T9>,\n s10: SchemaInput<T10>,\n): GraphQLSchemaDefinition<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<DeepMergeSchemas<DeepMergeSchemas<T1, T2>, T3>, T4>,\n T5\n >,\n T6\n >,\n T7\n >,\n T8\n >,\n T9\n >,\n T10\n >\n>;\nexport function mergeGraphQLSchemas<\n T1 extends GraphQLSchemaConfig,\n T2 extends GraphQLSchemaConfig,\n T3 extends GraphQLSchemaConfig,\n T4 extends GraphQLSchemaConfig,\n T5 extends GraphQLSchemaConfig,\n T6 extends GraphQLSchemaConfig,\n T7 extends GraphQLSchemaConfig,\n T8 extends GraphQLSchemaConfig,\n T9 extends GraphQLSchemaConfig,\n T10 extends GraphQLSchemaConfig,\n T11 extends GraphQLSchemaConfig,\n>(\n s1: SchemaInput<T1>,\n s2: SchemaInput<T2>,\n s3: SchemaInput<T3>,\n s4: SchemaInput<T4>,\n s5: SchemaInput<T5>,\n s6: SchemaInput<T6>,\n s7: SchemaInput<T7>,\n s8: SchemaInput<T8>,\n s9: SchemaInput<T9>,\n s10: SchemaInput<T10>,\n s11: SchemaInput<T11>,\n): GraphQLSchemaDefinition<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<DeepMergeSchemas<DeepMergeSchemas<T1, T2>, T3>, T4>,\n T5\n >,\n T6\n >,\n T7\n >,\n T8\n >,\n T9\n >,\n T10\n >,\n T11\n >\n>;\nexport function mergeGraphQLSchemas<\n T1 extends GraphQLSchemaConfig,\n T2 extends GraphQLSchemaConfig,\n T3 extends GraphQLSchemaConfig,\n T4 extends GraphQLSchemaConfig,\n T5 extends GraphQLSchemaConfig,\n T6 extends GraphQLSchemaConfig,\n T7 extends GraphQLSchemaConfig,\n T8 extends GraphQLSchemaConfig,\n T9 extends GraphQLSchemaConfig,\n T10 extends GraphQLSchemaConfig,\n T11 extends GraphQLSchemaConfig,\n T12 extends GraphQLSchemaConfig,\n>(\n s1: SchemaInput<T1>,\n s2: SchemaInput<T2>,\n s3: SchemaInput<T3>,\n s4: SchemaInput<T4>,\n s5: SchemaInput<T5>,\n s6: SchemaInput<T6>,\n s7: SchemaInput<T7>,\n s8: SchemaInput<T8>,\n s9: SchemaInput<T9>,\n s10: SchemaInput<T10>,\n s11: SchemaInput<T11>,\n s12: SchemaInput<T12>,\n): GraphQLSchemaDefinition<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<\n DeepMergeSchemas<DeepMergeSchemas<DeepMergeSchemas<T1, T2>, T3>, T4>,\n T5\n >,\n T6\n >,\n T7\n >,\n T8\n >,\n T9\n >,\n T10\n >,\n T11\n >,\n T12\n >\n>;\n\n// Variadic fallback for 13+\nexport function mergeGraphQLSchemas(\n ...schemas: SchemaInput<GraphQLSchemaConfig>[]\n): GraphQLSchemaDefinition<GraphQLSchemaConfig>;\n\n// Implementation\nexport function mergeGraphQLSchemas(\n ...schemas: SchemaInput<GraphQLSchemaConfig>[]\n): GraphQLSchemaDefinition<GraphQLSchemaConfig> {\n const merged = schemas.map(extractFields).reduce(deepMergeConfigs);\n return defineGraphQLSchema(merged);\n}\n","/**\n * @fileoverview GraphQL field utility functions.\n *\n * @module graphql/field/utils\n */\n\n/**\n * Generates a field ID from a schema key path.\n *\n * This is the **single source of truth** for the naming convention used across:\n * - SDL generation (`type Query { usersGet(...) }`)\n * - Yoga resolver map keys\n * - Client query string field names\n *\n * Converts dotted key paths to camelCase:\n * - `\"users.get\"` → `\"usersGet\"`\n * - `\"projects.members.list\"` → `\"projectsMembersList\"`\n * - `\"getUser\"` → `\"getUser\"` (single segment unchanged)\n *\n * @param key - The dotted schema key path\n * @returns A camelCase field ID string\n */\nexport function generateFieldId(key: string): string {\n return key\n .split('.')\n .map((segment, index) =>\n index === 0 ? segment : segment.charAt(0).toUpperCase() + segment.slice(1),\n )\n .join('');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC2EA,SAAS,sBAMP,WACA,OAMA;AACA,QAAM,aAAa;AAAA,IACjB;AAAA,IACA,OAAO,MAAM,SAAS;AAAA,IACtB,QAAQ,MAAM,UAAU;AAAA,IACxB,SAAS,MAAM,WAAW;AAAA,IAC1B,MAAM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