@trackunit/graphql-build-tools 0.0.61-alpha-06136b80b13.0 → 0.0.62
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 +12 -0
- package/package.json +1 -1
- package/bin/index.js.map +0 -1
- package/migrations/entry.js.map +0 -1
- package/src/cli.js.map +0 -1
- package/src/commands/build.js.map +0 -1
- package/src/commands/bundle.js.map +0 -1
- package/src/index.js.map +0 -1
- package/src/transformers/authorization-directive.js.map +0 -1
- package/src/transformers/complexity-directive.js.map +0 -1
- package/src/transformers/context.js.map +0 -1
- package/src/transformers/global-id-transformer.js.map +0 -1
- package/src/transformers/hidden-directive.js.map +0 -1
- package/src/transformers/map-id-values.js.map +0 -1
- package/src/transformers/preview-directive.js.map +0 -1
- package/src/transformers/reconcile-root-operation-types.js.map +0 -1
- package/src/transformers/transformer-chain.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 0.0.62 (2026-08-04)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for graphql-build-tools to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 0.0.61 (2026-08-04)
|
|
6
|
+
|
|
7
|
+
This was a version bump only for graphql-build-tools to align it with other projects, there were no code changes.
|
|
8
|
+
|
|
9
|
+
## 0.0.60 (2026-08-03)
|
|
10
|
+
|
|
11
|
+
This was a version bump only for graphql-build-tools to align it with other projects, there were no code changes.
|
|
12
|
+
|
|
1
13
|
## 0.0.59 (2026-08-03)
|
|
2
14
|
|
|
3
15
|
This was a version bump only for graphql-build-tools to align it with other projects, there were no code changes.
|
package/package.json
CHANGED
package/bin/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/graphql/build-tools/bin/index.ts"],"names":[],"mappings":";;;AACA,oCAAoC;AAEpC,KAAK,IAAA,YAAM,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IACjC,MAAM,EAAE,OAAO,CAAC,MAAM;IACtB,MAAM,EAAE,OAAO,CAAC,MAAM;CACvB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;IACjB,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC9B,CAAC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { runCli } from \"../src/cli\";\n\nvoid runCli(process.argv.slice(2), {\n stdout: process.stdout,\n stderr: process.stderr,\n}).then(exitCode => {\n process.exitCode = exitCode;\n});\n"]}
|
package/migrations/entry.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/graphql/build-tools/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["export {};\n"]}
|
package/src/cli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../../../libs/graphql/build-tools/src/cli.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,4CAAmD;AACnD,8CAAkD;AAClD,wEAAuE;AAWvE,MAAM,wBAAwB,GAAG,OAAC,CAAC,IAAI,CAAC,uCAAmB,CAAC,CAAC;AAE7D,MAAM,eAAe,GAAG,CAAC,KAAc,EAAU,EAAE;IACjD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG;;;;;;;;;;eAUH,uCAAmB,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;CAK5C,CAAC;AAEF,MAAM,cAAc,GAAG,CACrB,IAA2B,EAC4C,EAAE;IACzE,IAAI,MAA0B,CAAC;IAC/B,MAAM,UAAU,GAAkB,EAAE,CAAC;IAErC,KAAK,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I,CAAC;YACH,MAAM,SAAS,GAAG,MAAM,IAAA,uBAAe,EAAC;gBACtC,SAAS,EAAE,MAAM,CAAC,KAAK;gBACvB,UAAU,EAAE,MAAM,CAAC,MAAM;gBACzB,MAAM,EAAE,YAAY,CAAC,IAAI;aAC1B,CAAC,CAAC;YACH,IAAI,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,SAAS,IAAI,CAAC,CAAC;YACzC,CAAC;YACD,OAAO,CAAC,CAAC;QACX,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC3D,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,UAAU,KAAK,CAAC,CAAC;IACjE,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAxDW,QAAA,MAAM,UAwDjB","sourcesContent":["import { z } from \"zod\";\nimport { buildSchemaFile } from \"./commands/build\";\nimport { bundleSchemas } from \"./commands/bundle\";\nimport { graphqlGatewayNames } from \"./transformers/transformer-chain\";\n\ntype WritableStream = {\n readonly write: (message: string) => void;\n};\n\ntype CliStreams = {\n readonly stdout: WritableStream;\n readonly stderr: WritableStream;\n};\n\nconst graphqlGatewayNameSchema = z.enum(graphqlGatewayNames);\n\nconst getErrorMessage = (error: unknown): string => {\n if (error instanceof Error) {\n return error.message;\n }\n return String(error);\n};\n\nconst HELP_TEXT = `Usage: graphql-build-tools [command]\n\nBuild Manager-compatible GraphQL SDLs\n\nCommands:\n bundle <inputGlob> <outputFile>\n Collect many raw .graphqls files into one SDL\n\n build --server <server> <input> <output>\n Render a gateway-specific Manager SDL from bundled input\n Servers: ${graphqlGatewayNames.join(\", \")}\n Use \"-\" as <output> to write transformed SDL to stdout\n\nOptions:\n --help Show this help message\n`;\n\nconst parseBuildArgs = (\n args: ReadonlyArray<string>\n): { server: string; input: string; output: string } | { error: string } => {\n let server: string | undefined;\n const positional: Array<string> = [];\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n if (arg === undefined) continue;\n if (arg.startsWith(\"--server=\")) {\n server = arg.slice(\"--server=\".length);\n } else if (arg === \"--server\") {\n const next = args[i + 1];\n if (next !== undefined) {\n server = next;\n i++;\n }\n } else {\n positional.push(arg);\n }\n }\n\n if (!server) {\n return { error: `required option --server missing. Expected one of: ${graphqlGatewayNames.join(\", \")}` };\n }\n\n const [input, output] = positional;\n if (!input || !output) {\n return { error: \"build requires <input> and <output> arguments\" };\n }\n\n return { server, input, output };\n};\n\nexport const runCli = async (argv: ReadonlyArray<string>, streams: CliStreams): Promise<number> => {\n const [subcommand, ...rest] = argv;\n\n if (!subcommand || subcommand === \"--help\" || subcommand === \"-h\") {\n streams.stdout.write(HELP_TEXT);\n return 0;\n }\n\n if (subcommand === \"bundle\") {\n const [inputGlob, outputFile] = rest;\n if (!inputGlob || !outputFile) {\n streams.stderr.write(\"Error: bundle requires <inputGlob> and <outputFile> arguments\\n\");\n return 1;\n }\n try {\n await bundleSchemas({ inputGlob, outputFile });\n return 0;\n } catch (error) {\n streams.stderr.write(`Error: ${getErrorMessage(error)}\\n`);\n return 1;\n }\n }\n\n if (subcommand === \"build\") {\n const parsed = parseBuildArgs(rest);\n if (\"error\" in parsed) {\n streams.stderr.write(`Error: ${parsed.error}\\n`);\n return 1;\n }\n\n const parsedServer = graphqlGatewayNameSchema.safeParse(parsed.server);\n if (!parsedServer.success) {\n streams.stderr.write(\n `Error: Unknown server \"${parsed.server}\". Expected one of: ${graphqlGatewayNames.join(\", \")}\\n`\n );\n return 1;\n }\n\n try {\n const outputSdl = await buildSchemaFile({\n inputFile: parsed.input,\n outputFile: parsed.output,\n server: parsedServer.data,\n });\n if (parsed.output === \"-\") {\n streams.stdout.write(`${outputSdl}\\n`);\n }\n return 0;\n } catch (error) {\n streams.stderr.write(`Error: ${getErrorMessage(error)}\\n`);\n return 1;\n }\n }\n\n streams.stderr.write(`Error: unknown command \"${subcommand}\"\\n`);\n return 1;\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../../../../libs/graphql/build-tools/src/commands/build.ts"],"names":[],"mappings":";;;AAAA,+CAA8D;AAC9D,yCAAoC;AACpC,yEAAuG;AAQhG,MAAM,kBAAkB,GAAG,CAAC,MAA0B,EAAE,QAAgB,EAAU,EAAE;IACzF,OAAO,IAAA,6CAAyB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACrD,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B;AAEK,MAAM,eAAe,GAAG,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAsB,EAAmB,EAAE;IAC9G,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,IAAA,0BAAkB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEvD,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;QACvB,MAAM,IAAA,gBAAK,EAAC,IAAA,mBAAO,EAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,MAAM,IAAA,oBAAS,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAVW,QAAA,eAAe,mBAU1B","sourcesContent":["import { mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\nimport { buildTransformedSchemaSdl, type GraphqlGatewayName } from \"../transformers/transformer-chain\";\n\nexport type BuildSchemaOptions = {\n readonly inputFile: string;\n readonly outputFile: string;\n readonly server: GraphqlGatewayName;\n};\n\nexport const buildGraphqlSchema = (server: GraphqlGatewayName, inputSdl: string): string => {\n return buildTransformedSchemaSdl(server, inputSdl);\n};\n\nexport const buildSchemaFile = async ({ inputFile, outputFile, server }: BuildSchemaOptions): Promise<string> => {\n const inputSdl = await readFile(inputFile, \"utf8\");\n const outputSdl = buildGraphqlSchema(server, inputSdl);\n\n if (outputFile !== \"-\") {\n await mkdir(dirname(outputFile), { recursive: true });\n await writeFile(outputFile, outputSdl);\n }\n\n return outputSdl;\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../../../../../libs/graphql/build-tools/src/commands/bundle.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAC5B,+CAA8D;AAC9D,yCAAoC;AAO7B,MAAM,aAAa,GAAG,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,EAAwB,EAAiB,EAAE;IACpG,MAAM,KAAK,GAAG,CAAC,MAAM,IAAA,WAAI,EAAC,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC7G,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,sCAAsC,SAAS,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAA,mBAAQ,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAC9E,MAAM,IAAA,gBAAK,EAAC,IAAA,mBAAO,EAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,MAAM,IAAA,oBAAS,EAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACnD,CAAC,CAAC;AATW,QAAA,aAAa,iBASxB","sourcesContent":["import { glob } from \"glob\";\nimport { mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\n\nexport type BundleSchemasOptions = {\n readonly inputGlob: string;\n readonly outputFile: string;\n};\n\nexport const bundleSchemas = async ({ inputGlob, outputFile }: BundleSchemasOptions): Promise<void> => {\n const files = (await glob(inputGlob, { nodir: true })).filter(file => file.endsWith(\".graphqls\")).toSorted();\n if (files.length === 0) {\n throw new Error(`No schema files found for pattern: ${inputGlob}`);\n }\n\n const contents = await Promise.all(files.map(file => readFile(file, \"utf8\")));\n await mkdir(dirname(outputFile), { recursive: true });\n await writeFile(outputFile, contents.join(\"\\n\"));\n};\n"]}
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/graphql/build-tools/src/index.ts"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAAtB,6FAAA,MAAM,OAAA;AACf,0CAAuE;AAA9D,2GAAA,kBAAkB,OAAA;AAAE,wGAAA,eAAe,OAAA;AAE5C,4CAAkD;AAAzC,uGAAA,aAAa,OAAA;AAEtB,iFAAuD;AACvD,8EAAoD;AACpD,+EAAqD;AACrD,0EAAgD;AAChD,2EAAiD;AACjD,2EAAiD","sourcesContent":["export { runCli } from \"./cli\";\nexport { buildGraphqlSchema, buildSchemaFile } from \"./commands/build\";\nexport type { BuildSchemaOptions } from \"./commands/build\";\nexport { bundleSchemas } from \"./commands/bundle\";\nexport type { BundleSchemasOptions } from \"./commands/bundle\";\nexport * from \"./transformers/authorization-directive\";\nexport * from \"./transformers/complexity-directive\";\nexport * from \"./transformers/global-id-transformer\";\nexport * from \"./transformers/hidden-directive\";\nexport * from \"./transformers/preview-directive\";\nexport * from \"./transformers/transformer-chain\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authorization-directive.js","sourceRoot":"","sources":["../../../../../../libs/graphql/build-tools/src/transformers/authorization-directive.ts"],"names":[],"mappings":";;;AAAA,gDAA2E;AAOpE,MAAM,6BAA6B,GAAG,CAC3C,SAA8C,EACN,EAAE;IAC1C,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,EAAE,CAAC;QAClG,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,CAAC;AACpC,CAAC,CAAC;AAVW,QAAA,6BAA6B,iCAUxC;AAEF,MAAM,4BAA4B,GAAG,CAAC,aAAoC,EAAU,EAAE,CACpF,oBAAoB,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;AAEnD,MAAM,+BAA+B,GAAG,CACtC,WAAsC,EACtC,yBAAiC,EACzB,EAAE;IACV,MAAM,mBAAmB,GAAG,WAAW,IAAI,EAAE,CAAC;IAC9C,IAAI,mBAAmB,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EAAE,CAAC;QAC5D,OAAO,mBAAmB,CAAC,IAAI,EAAE,CAAC;IACpC,CAAC;IACD,OAAO,GAAG,mBAAmB,OAAO,yBAAyB,EAAE,CAAC,IAAI,EAAE,CAAC;AACzE,CAAC,CAAC;AAEK,MAAM,sBAAsB,GAAG,CAAC,aAAa,GAAG,eAAe,EAAE,EAAE;IACxE,MAAM,yBAAyB,GAA+C,EAAE,CAAC;IACjF,OAAO;QACL,8BAA8B,EAAE;;iBAEnB,aAAa;;;mCAGK;QAC/B,iCAAiC,EAAE,CAAC,MAAqB,EA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A,sBAAsB,0BAyCjC","sourcesContent":["import { getDirective, MapperKind, mapSchema } from \"@graphql-tools/utils\";\nimport type { GraphQLSchema } from \"graphql\";\n\nexport type AuthorizationDirectiveArgs = {\n readonly allow: Array<string>;\n};\n\nexport const getAuthorizationDirectiveArgs = (\n directive: Record<string, unknown> | undefined\n): AuthorizationDirectiveArgs | undefined => {\n if (directive === undefined) {\n return undefined;\n }\n if (!Array.isArray(directive.allow) || !directive.allow.every(scope => typeof scope === \"string\")) {\n throw new Error(\"Missing allow array on authorization directive\");\n }\n return { allow: directive.allow };\n};\n\nconst getRequiredScopesDescription = (allowedScopes: ReadonlyArray<string>): string =>\n `Required scopes: ${allowedScopes.join(\" or \")}`;\n\nconst appendRequiredScopesDescription = (\n description: string | null | undefined,\n requiredScopesDescription: string\n): string => {\n const existingDescription = description ?? \"\";\n if (existingDescription.includes(requiredScopesDescription)) {\n return existingDescription.trim();\n }\n return `${existingDescription}\\n\\n${requiredScopesDescription}`.trim();\n};\n\nexport const authorizationDirective = (directiveName = \"authorization\") => {\n const typeDirectiveArgumentMaps: Record<string, AuthorizationDirectiveArgs> = {};\n return {\n authorizationDirectiveTypeDefs: `\n \"\"\"The authorization directive marks elements requiring a special scope.\"\"\"\n directive @${directiveName}(\n \"\"\" The allowed scopes for the call. Token should have at least one of the listed scopes.\"\"\"\n allow: [String!]!\n ) on OBJECT | FIELD_DEFINITION`,\n authorizationDirectiveTransformer: (schema: GraphQLSchema): GraphQLSchema =>\n mapSchema(schema, {\n [MapperKind.TYPE]: type => {\n const directive = getAuthorizationDirectiveArgs(getDirective(schema, type, directiveName)?.[0]);\n if (directive) {\n typeDirectiveArgumentMaps[type.name] = directive;\n }\n return undefined;\n },\n [MapperKind.OBJECT_FIELD]: (fieldConfig, _fieldName, typeName) => {\n const directive =\n getAuthorizationDirectiveArgs(getDirective(schema, fieldConfig, directiveName)?.[0]) ??\n typeDirectiveArgumentMaps[typeName];\n if (directive) {\n const allowedScopes = directive.allow;\n const requiredScopesDescription = getRequiredScopesDescription(allowedScopes);\n\n fieldConfig.description = appendRequiredScopesDescription(\n fieldConfig.description,\n requiredScopesDescription\n );\n if (fieldConfig.astNode?.description) {\n fieldConfig.astNode = {\n ...fieldConfig.astNode,\n description: { ...fieldConfig.astNode.description, value: fieldConfig.description },\n };\n }\n }\n return fieldConfig;\n },\n }),\n };\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"complexity-directive.js","sourceRoot":"","sources":["../../../../../../libs/graphql/build-tools/src/transformers/complexity-directive.ts"],"names":[],"mappings":";;;AAAA,gDAA2E;AAG3E,MAAM,aAAa,GAAG,CAAC,KAAc,EAA6B,EAAE;IAClE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC,CAAC;AAEK,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,aAAa,GAAG,YAAY,CAAC;IACnC,OAAO;QACL,2BAA2B,EAAE;;iBAEhB,aAAa;;;;;;0BAMJ;QACtB,8BAA8B,EAAE,CAAC,MAAqB,EAAiB,EAAE,CACvE,IAAA,iBAAS,EAAC,MAAM,EAAE;YAChB,CAAC,kBAAU,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC,EAAE;gBACvC,MAAM,SAAS,GAAG,IAAA,oBAAY,EAAC,MAAM,EAAE,WAAW,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;gBACxE,IAAI,SAAS,EAAE,CAAC;oBACd,MAAM,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC;oBAC5B,MAAM,WAAW,GAAG,aAAa,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;oBAEzD,WAAW,CAAC,WAAW,GAAG,CACxB,CAAC,WAAW,CAAC,WAAW,IAAI,EAAE,CAAC;wBAC/B,wBAAwB,KAAK,EAAE;wBAC/B,CAAC,WAAW;4BACV,CAAC,CAAC,4EAA4E,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;4BACtG,CAAC,CAAC,EAAE,CAAC,CACR,CAAC,IAAI,EAAE,CAAC;oBACT,IAAI,WAAW,CAAC,OAAO,EAAE,WAAW,EAAE,CAAC;wBACrC,WAAW,CAAC,OAAO,GAAG;4BACpB,GAAG,WAAW,CAAC,OAAO;4BACtB,WAAW,EAAE,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,EAAE,WAAW,CAAC,WAAW,EAAE;yBACpF,CAAC;oBACJ,CAAC;gBACH,CAAC;gBACD,OAAO,WAAW,CAAC;YACrB,CAAC;SACF,CAAC;KACL,CAAC;AACJ,CAAC,CAAC;AAtCW,QAAA,mBAAmB,uBAsC9B","sourcesContent":["import { getDirective, MapperKind, mapSchema } from \"@graphql-tools/utils\";\nimport type { GraphQLSchema } from \"graphql\";\n\nconst getStringList = (value: unknown): Array<string> | undefined => {\n if (!Array.isArray(value)) {\n return undefined;\n }\n return value.every(item => typeof item === \"string\") ? value : undefined;\n};\n\nexport const complexityDirective = () => {\n const directiveName = \"complexity\";\n return {\n complexityDirectiveTypeDefs: `\n \"\"\"The complexity cost\"\"\"\n directive @${directiveName}(\n # The complexity value for the field\n value: Int!\n\n # Optional multipliers\n multipliers: [String!]\n ) on FIELD_DEFINITION`,\n complexityDirectiveTransformer: (schema: GraphQLSchema): GraphQLSchema =>\n mapSchema(schema, {\n [MapperKind.OBJECT_FIELD]: fieldConfig => {\n const directive = getDirective(schema, fieldConfig, directiveName)?.[0];\n if (directive) {\n const { value } = directive;\n const multipliers = getStringList(directive.multipliers);\n\n fieldConfig.description = (\n (fieldConfig.description ?? \"\") +\n `\\n\\nComplexity cost: ${value}` +\n (multipliers\n ? `, multiplied by the smallest numeric argument value or list length among ${multipliers.join(\", \")}`\n : \"\")\n ).trim();\n if (fieldConfig.astNode?.description) {\n fieldConfig.astNode = {\n ...fieldConfig.astNode,\n description: { ...fieldConfig.astNode.description, value: fieldConfig.description },\n };\n }\n }\n return fieldConfig;\n },\n }),\n };\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../../../libs/graphql/build-tools/src/transformers/context.ts"],"names":[],"mappings":"","sourcesContent":["export type TrackunitSchemaTransformerToken = {\n readonly aud?: string;\n readonly cid?: string;\n readonly irisAppId?: string;\n readonly organizationId?: string;\n readonly sub?: string;\n readonly scp?: Array<string>;\n};\n\nexport type SchemaTransformerContext = {\n readonly apollographqlClientName?: string;\n readonly apollographqlClientVersion?: string;\n readonly graphqlClientName?: string;\n readonly graphqlClientVersion?: string;\n readonly trackunitAppVersion?: string;\n readonly trackunitManifestScopes?: Array<string>;\n readonly trackunitPreviewFeatures?: Array<string>;\n readonly trackunitToken?: TrackunitSchemaTransformerToken;\n readonly userAgent?: string;\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"global-id-transformer.js","sourceRoot":"","sources":["../../../../../../libs/graphql/build-tools/src/transformers/global-id-transformer.ts"],"names":[],"mappings":";;;AAAA,gDAA6D;AAC7D,8CAAiD;AACjD,2CAAwC;AACxC,qCAA2F;AAC3F,mDAA8C;AAE9C,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAMnB,QAAA,aAAa,GAAG,mBAAmB,CAAC;AAEjD,MAAM,WAAW,GAAG,IAAI,2BAAW,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;IACtD,IAAI,QAAQ,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC1F,MAAM,KAAK,GAAG,KAAK,CAAC,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wBAC5E,CAAC;qBACF,CAAC;oBACF,OAAO,IAAI,2BAAiB,CAAC,MAAM,CAAC,CAAC;gBACvC,CAAC;YACH,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;KACF,CAAC;CACH,CAAC,CAAC;AAhCQ,QAAA,mBAAmB,uBAgC3B","sourcesContent":["import { MapperKind, mapSchema } from \"@graphql-tools/utils\";\nimport { wrapSchema } from \"@graphql-tools/wrap\";\nimport { lowerFirst } from \"es-toolkit\";\nimport { GraphQLID, GraphQLNonNull, GraphQLObjectType, type GraphQLSchema } from \"graphql\";\nimport { MapIDValues } from \"./map-id-values\";\n\nconst globalIdSeparator = \"___\";\n\ntype NodeLike = {\n readonly id: string;\n};\n\nexport const globalIdRegex = /___([^_]+)___(.+)/;\n\nconst mapIDValues = new MapIDValues((typeName, value) => {\n if (typeName === \"ID\" && typeof value === \"string\" && value.startsWith(globalIdSeparator)) {\n const match = value.match(globalIdRegex);\n return match?.[2];\n }\n return undefined;\n});\n\nexport const globalIdTransformer = (schema: GraphQLSchema): GraphQLSchema =>\n wrapSchema({\n transforms: [mapIDValues],\n schema: mapSchema(schema, {\n [MapperKind.OBJECT_TYPE]: type => {\n const typeInterfaces = type.getInterfaces();\n for (const typeInterface of typeInterfaces) {\n if (typeInterface.name === \"Node\") {\n const config = type.toConfig();\n const rawIdFieldName = `${lowerFirst(type.name)}Id`;\n config.fields[rawIdFieldName] = {\n type: new GraphQLNonNull(GraphQLID),\n description: `${type.name} Entity ID`,\n args: {},\n resolve(object: NodeLike) {\n return object.id;\n },\n };\n config.fields.id = {\n type: new GraphQLNonNull(GraphQLID),\n description: `Globally unique ID for ${type.name}`,\n args: {},\n resolve(object: NodeLike) {\n return `${globalIdSeparator}${type.name}${globalIdSeparator}${object.id}`;\n },\n };\n return new GraphQLObjectType(config);\n }\n }\n return undefined;\n },\n }),\n });\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hidden-directive.js","sourceRoot":"","s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AE,cAAc,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAC7E,IAAI,CAAC,aAAa,CACnB,CAAC;YACJ,CAAC;YACD,eAAe,EAAE,CAAC,SAAiB,EAAE,UAAkB,EAAE,WAAmC,EAAE,EAAE;gBAC9F,OAAO,uBAAuB,CAC5B,IAAA,oBAAY,EAAC,sBAAsB,EAAE,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAC1E,IAAI,CAAC,aAAa,CACnB,CAAC;YACJ,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAYM,MAAM,eAAe,GAAG,CAC7B,aAAqB;AACrB,oGAAoG;AACpG,yBAA0D,EAAE,EAC5D,EAAE;IACF,MAAM,EAAE,aAAa,GAAG,QAAQ,EAAE,4BAA4B,GAAG,KAAK,EAAE,GACtE,OAAO,sBAAsB,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,sBAAsB,EAAE,CAAC,CAAC,CAAC,sBAAsB,CAAC;IAElH,OAAO;QACL,uBAAuB,EAAE;;iBAEZ,aAAa;;;kJAGoH;QAC9I,0BAA0B,EAAE,CAAC,MAAqB,EAAiB,EAAE,CACnE,IAAA,iBAAS,EACP,IAAA,iBAAU,EAAC;YACT,MAAM;YACN,UAAU,EAAE;gBACV,IAAI,6BAA6B,CAAC,aAAa,EAAE,aAAa,EAAE,4BAA4B,CAAC;gBAC7F,IAAI,kCAA2B,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,KAAK,aAAa,CAAC;gBACzE,IAAI,kBAAW,CAAC,EAAE,CAAC;aACpB;SACF,CAAC,EACF,EAAE,CACH;KACJ,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,eAAe,mBA4B1B","sourcesContent":["import { filterSchema, getDirective, mapSchema } from \"@graphql-tools/utils\";\nimport { FilterObjectFieldDirectives, PruneSchema, wrapSchema } from \"@graphql-tools/wrap\";\nimport { isNamedType, type GraphQLEnumValueConfig, type GraphQLSchema } from \"graphql\";\n\nconst shouldPreserveDirective = (directive: Record<string, unknown> | undefined, currentServer: string): boolean => {\n if (directive === undefined) {\n return true;\n }\n\n if (directive.servers === undefined) {\n return false;\n }\n if (!Array.isArray(directive.servers)) {\n return false;\n }\n\n return !directive.servers.some(server => server === currentServer);\n};\n\n// Schema-stitching entry points. A subgraph whose only root fields are @hidden @merge resolvers\n// (e.g. a service that just extends a shared type) would otherwise be pruned to an empty schema.\n// Keeping these fields preserves the stitching scaffolding so the per-server SDL stays valid and composable.\nconst STITCHING_FIELD_DIRECTIVES = [\"merge\", \"computed\"] as const;\n\nconst hasStitchingDirective = (schema: GraphQLSchema, fieldConfig: Parameters<typeof getDirective>[1]): boolean =>\n STITCHING_FIELD_DIRECTIVES.some(name => (getDirective(schema, fieldConfig, name)?.length ?? 0) > 0);\n\nclass RemoveHiddenElementsTransform {\n public constructor(\n private readonly currentServer: string,\n private readonly directiveName: string,\n private readonly preserveStitchingEntrypoints: boolean\n ) {}\n\n public transformSchema(originalWrappingSchema: GraphQLSchema): GraphQLSchema {\n return filterSchema({\n schema: originalWrappingSchema,\n typeFilter: (_typeName, type) => {\n if (!isNamedType(type)) {\n return true;\n }\n return shouldPreserveDirective(\n getDirective(originalWrappingSchema, type, this.directiveName)?.[0],\n this.currentServer\n );\n },\n rootFieldFilter: (_operationName, _fieldName, fieldConfig) => {\n if (this.preserveStitchingEntrypoints && hasStitchingDirective(originalWrappingSchema, fieldConfig)) {\n return true;\n }\n return shouldPreserveDirective(\n getDirective(originalWrappingSchema, fieldConfig, this.directiveName)?.[0],\n this.currentServer\n );\n },\n fieldFilter: (_typeName, _fieldName, fieldConfig) => {\n if (this.preserveStitchingEntrypoints && hasStitchingDirective(originalWrappingSchema, fieldConfig)) {\n return true;\n }\n return shouldPreserveDirective(\n getDirective(originalWrappingSchema, fieldConfig, this.directiveName)?.[0],\n this.currentServer\n );\n },\n argumentFilter: (_typeName, _fieldName, _argName, argumentConfig) => {\n if (argumentConfig === undefined) {\n return true;\n }\n return shouldPreserveDirective(\n getDirective(originalWrappingSchema, argumentConfig, this.directiveName)?.[0],\n this.currentServer\n );\n },\n enumValueFilter: (_typeName: string, _valueName: string, valueConfig: GraphQLEnumValueConfig) => {\n return shouldPreserveDirective(\n getDirective(originalWrappingSchema, valueConfig, this.directiveName)?.[0],\n this.currentServer\n );\n },\n });\n }\n}\n\nexport type HiddenDirectiveOptions = {\n readonly directiveName?: string;\n /**\n * When true, root/object fields that carry a schema-stitching directive (@merge, @computed) are kept\n * even if marked @hidden. This is only relevant when building a single subgraph's SDL (the CLI build\n * path); the runtime gateway must keep the default (false) so stitching entry points stay hidden from users.\n */\n readonly preserveStitchingEntrypoints?: boolean;\n};\n\nexport const hiddenDirective = (\n currentServer: string,\n // Accepts the legacy `directiveName` string form for backwards compatibility, or an options object.\n optionsOrDirectiveName: string | HiddenDirectiveOptions = {}\n) => {\n const { directiveName = \"hidden\", preserveStitchingEntrypoints = false } =\n typeof optionsOrDirectiveName === \"string\" ? { directiveName: optionsOrDirectiveName } : optionsOrDirectiveName;\n\n return {\n hiddenDirectiveTypeDefs: `\n \"\"\"The hidden directive will be used to mark elements that should not be presented in the public graph.\"\"\"\n directive @${directiveName}(\n # The servers on which the properties should be hidden\n servers: [String]\n ) on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION`,\n hiddenDirectiveTransformer: (schema: GraphQLSchema): GraphQLSchema =>\n mapSchema(\n wrapSchema({\n schema,\n transforms: [\n new RemoveHiddenElementsTransform(currentServer, directiveName, preserveStitchingEntrypoints),\n new FilterObjectFieldDirectives(directive => directive !== directiveName),\n new PruneSchema({}),\n ],\n }),\n {}\n ),\n };\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map-id-values.js","sourceRoot":"","sources":["../../../../../../libs/graphql/build-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C;gBAC7D,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;oBACtF,eAAe,CAAC,OAAO,CAAC,GAAG;wBACzB,GAAG,YAAY;wBACf,KAAK,EAAE,YAAY;qBACpB,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO;YACL,GAAG,KAAK;YACR,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC;SAC1C,CAAC;IACJ,CAAC;CACF;AAhLD,kCAgLC","sourcesContent":["import type { DelegationContext, SubschemaConfig, Transform } from \"@graphql-tools/delegate\";\nimport { transformInputValue, type ExecutionRequest } from \"@graphql-tools/utils\";\nimport type { LeafValueTransformer } from \"@graphql-tools/wrap\";\nimport {\n GraphQLNonNull,\n Kind,\n TypeInfo,\n astFromValue,\n valueFromAST,\n valueFromASTUntyped,\n visit,\n visitWithTypeInfo,\n type ArgumentNode,\n type FieldNode,\n type FragmentDefinitionNode,\n type GraphQLSchema,\n type OperationDefinitionNode,\n} from \"graphql\";\n\ntype MapLeafValuesTransformationContext = {\n transformedRequest: ExecutionRequest;\n};\n\nexport class MapIDValues<TContext = Record<string, unknown>>\n implements Transform<MapLeafValuesTransformationContext, TContext>\n{\n private readonly inputValueTransformer: LeafValueTransformer;\n private typeInfo?: TypeInfo;\n\n public constructor(inputValueTransformer: LeafValueTransformer) {\n this.inputValueTransformer = inputValueTransformer;\n }\n\n public transformSchema(\n originalWrappingSchema: GraphQLSchema,\n _subschemaConfig: SubschemaConfig<unknown, unknown, unknown, TContext>\n ): GraphQLSchema {\n this.typeInfo = new TypeInfo(originalWrappingSchema);\n return originalWrappingSchema;\n }\n\n public transformRequest(\n originalRequest: ExecutionRequest,\n delegationContext: DelegationContext<TContext>,\n transformationContext: MapLeafValuesTransformationContext\n ): ExecutionRequest {\n const document = originalRequest.document;\n const variableValues = originalRequest.variables ?? {};\n\n const operations: Array<OperationDefinitionNode> = document.definitions.filter(\n def => def.kind === Kind.OPERATION_DEFINITION\n );\n const fragments: Array<FragmentDefinitionNode> = document.definitions.filter(\n def => def.kind === Kind.FRAGMENT_DEFINITION\n );\n\n const newOperations = this.transformOperations(operations, variableValues, delegationContext.args);\n\n const transformedRequest = {\n ...originalRequest,\n document: {\n ...document,\n definitions: [...newOperations, ...fragments],\n },\n variables: variableValues,\n };\n\n transformationContext.transformedRequest = transformedRequest;\n return transformedRequest;\n }\n\n private transformOperations(\n operations: Array<OperationDefinitionNode>,\n variableValues: Record<string, unknown>,\n args?: Record<string, unknown>\n ): Array<OperationDefinitionNode> {\n const typeInfo = this.typeInfo;\n if (!typeInfo) {\n throw new Error(\n `The MapLeafValues transform's \"transformRequest\" and \"transformResult\" methods cannot be used without first calling \"transformSchema\".`\n );\n }\n return operations.map((operation: OperationDefinitionNode) =>\n visit(\n operation,\n visitWithTypeInfo(typeInfo, {\n [Kind.FIELD]: node => this.transformFieldNode(node, variableValues, args),\n [Kind.SELECTION_SET]: node => {\n const nodeIdFieldName = \"id\";\n let type = typeInfo.getType();\n if (type) {\n if (type instanceof GraphQLNonNull) {\n type = type.ofType;\n }\n if (\n \"getInterfaces\" in type &&\n type.getInterfaces().some(typeInterface => typeInterface.name === \"Node\")\n ) {\n if (\n !node.selections.some(\n selection => selection.kind === Kind.FIELD && selection.name.value === nodeIdFieldName\n )\n ) {\n return {\n ...node,\n selections: [\n ...node.selections,\n {\n kind: Kind.FIELD,\n name: {\n kind: Kind.NAME,\n value: nodeIdFieldName,\n },\n },\n ],\n };\n }\n }\n }\n return undefined;\n },\n })\n )\n );\n }\n\n private transformFieldNode(\n field: FieldNode,\n variableValues: Record<string, unknown>,\n args?: Record<string, unknown>\n ): FieldNode | undefined {\n if (!this.typeInfo) {\n throw new Error(\n `The MapLeafValues transform's \"transformRequest\" and \"transformResult\" methods cannot be used without first calling \"transformSchema\".`\n );\n }\n const targetField = this.typeInfo.getFieldDef();\n\n if (!targetField) {\n return undefined;\n }\n\n if (targetField.name === \"node\" || targetField.name.startsWith(\"__\")) {\n return undefined;\n }\n\n const argumentNodes = field.arguments;\n if (!Array.isArray(argumentNodes)) {\n return undefined;\n }\n\n const argumentNodeMap: Record<string, ArgumentNode> = {};\n for (const argument of argumentNodes) {\n argumentNodeMap[argument.name.value] = argument;\n }\n\n for (const argument of targetField.args) {\n const argName = argument.name;\n const argType = argument.type;\n if (args?.[argName] !== undefined) {\n args[argName] = transformInputValue(argType, args[argName], (type, inputValue) => {\n const newValue = this.inputValueTransformer(type.name, inputValue);\n return newValue === undefined ? inputValue : newValue;\n });\n }\n\n const argumentNode = argumentNodeMap[argName];\n let value: unknown;\n const argValue = argumentNode?.value;\n if (argValue !== undefined) {\n value = valueFromAST(argValue, argType, variableValues);\n if (value === undefined || value === null) {\n value = valueFromASTUntyped(argValue, variableValues);\n }\n }\n\n const transformedValue = transformInputValue(argType, value, (type, inputValue) => {\n const newValue = this.inputValueTransformer(type.name, inputValue);\n return newValue === undefined ? inputValue : newValue;\n });\n\n if (argValue?.kind === Kind.VARIABLE) {\n variableValues[argValue.name.value] = transformedValue;\n } else {\n const newValueNode = astFromValue(transformedValue, argType);\n if (newValueNode !== undefined && newValueNode !== null && argumentNode !== undefined) {\n argumentNodeMap[argName] = {\n ...argumentNode,\n value: newValueNode,\n };\n }\n }\n }\n\n return {\n ...field,\n arguments: Object.values(argumentNodeMap),\n };\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preview-directive.js","sourceRoot":"","sources":["../../../../../../libs/graphql/build-tools/src/transformers/preview-directive.ts"],"names":[],"mappings":";;;AAAA,gDAA2E;AAC3E,qCAMiB;AAOjB,MAAM,uBAAuB,GAAG,CAAC,SAA8C,EAAoC,EAAE;IACnH,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,OAAO,SAAS,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,C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CAAC;gBACD,OAAO,WAAW,CAAC;YACrB,CAAC;SACF,CAAC;KACL,CAAC;AACJ,CAAC,CAAC;AA3DW,QAAA,gBAAgB,oBA2D3B","sourcesContent":["import { getDirective, MapperKind, mapSchema } from \"@graphql-tools/utils\";\nimport {\n defaultFieldResolver,\n GraphQLError,\n GraphQLNonNull,\n type GraphQLFieldResolver,\n type GraphQLSchema,\n} from \"graphql\";\nimport type { SchemaTransformerContext } from \"./context\";\n\ntype PreviewDirectiveArgs = {\n readonly codename: string;\n};\n\nconst getPreviewDirectiveArgs = (directive: Record<string, unknown> | undefined): PreviewDirectiveArgs | undefined => {\n if (directive === undefined) {\n return undefined;\n }\n return typeof directive.codename === \"string\" ? { codename: directive.codename } : undefined;\n};\n\nexport const previewDirective = (directiveName = \"preview\") => {\n const typeDirectiveArgumentMaps: Record<string, PreviewDirectiveArgs> = {};\n return {\n previewDirectiveTypeDefs: `\n \"\"\"The preview directive will be used to indicate fields that are still under development\"\"\"\n directive @${directiveName}(\n # Indicates the code name for this feature, which should be included in the TU-PREVIEW HTTP header.\n codename: String!\n ) on ARGUMENT_DEFINITION | ENUM | ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | INPUT_OBJECT | INTERFACE | OBJECT | SCALAR | UNION`,\n previewDirectiveTransformer: (schema: GraphQLSchema): GraphQLSchema =>\n mapSchema(schema, {\n [MapperKind.TYPE]: type => {\n const directive = getPreviewDirectiveArgs(getDirective(schema, type, directiveName)?.[0]);\n if (directive) {\n typeDirectiveArgumentMaps[type.name] = directive;\n }\n return undefined;\n },\n [MapperKind.OBJECT_FIELD]: (fieldConfig, fieldName, typeName) => {\n const directive =\n getPreviewDirectiveArgs(getDirective(schema, fieldConfig, directiveName)?.[0]) ??\n typeDirectiveArgumentMaps[typeName];\n if (directive) {\n const { codename } = directive;\n if (fieldConfig.type instanceof GraphQLNonNull) {\n if (typeName !== \"Query\" && typeName !== \"Mutation\" && typeName !== \"Subscription\") {\n throw new Error(`Preview field ${typeName}.${fieldName} cannot be non-null`);\n }\n }\n\n const resolve: GraphQLFieldResolver<unknown, SchemaTransformerContext> =\n fieldConfig.resolve ?? defaultFieldResolver;\n fieldConfig.resolve = (source, args, context: SchemaTransformerContext, info) => {\n const previewFeatures = context.trackunitPreviewFeatures;\n const errorMessage = `Requested field '${fieldName}' is a preview feature. This means it may change without notice. To indicate you accept these terms pass the HTTP header 'TU-PREVIEW: ${codename}' with your query requests.`;\n if (!previewFeatures) {\n throw new GraphQLError(errorMessage, { extensions: { code: \"BAD_USER_INPUT\" } });\n }\n if (!previewFeatures.includes(\"*\") && !previewFeatures.includes(codename)) {\n throw new GraphQLError(errorMessage, { extensions: { code: \"BAD_USER_INPUT\" } });\n }\n return resolve(source, args, context, info);\n };\n\n fieldConfig.description = (\n (fieldConfig.description ?? \"\") +\n `\\n\\n**This is a preview feature.** This means it may change without notice. To indicate you accept these terms pass the HTTP header 'TU-PREVIEW: ${codename}' with your query requests.`\n ).trim();\n if (fieldConfig.astNode?.description) {\n fieldConfig.astNode = {\n ...fieldConfig.astNode,\n description: { ...fieldConfig.astNode.description, value: fieldConfig.description },\n };\n }\n }\n return fieldConfig;\n },\n }),\n };\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile-root-operation-types.js","sourceRoot":"","sources":["../../../../../../libs/graphql/build-tools/src/transformers/reconcile-root-operation-types.ts"],"names":[],"mappings":";;;AAAA,qCAAqH;AAErH;;;;;;;;;;;;GAYG;AAEH,MAAM,oBAAoB,GAAG,CAAC,IAA0C,EAA6B,EAAE,CACrG,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAElF,wFAAwF;AACxF,MAAM,sBAAsB,GAAG,CAAC,MAAqB,EAAkC,EAAE;IACvF,MAAM,UAAU,GAAG,IAAI,GAAG,EAAq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ACvC,CAAC;IACH,CAAC,CAAC;IACF,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACtC,YAAY,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAC5C,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;IAEpD,MAAM,iBAAiB,GACrB,MAAM,CAAC,OAAO,KAAK,IAAI,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS;QACrD,CAAC,CAAC,MAAM,CAAC,OAAO;QAChB,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,EAAE,cAAc,EAAE,sBAAsB,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC;IAEnH,OAAO,IAAI,uBAAa,CAAC;QACvB,GAAG,MAAM;QACT,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,YAAY;QACtB,YAAY,EAAE,gBAAgB;QAC9B,8FAA8F;QAC9F,+FAA+F;QAC/F,kEAAkE;QAClE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrE,iGAAiG;QACjG,OAAO,EAAE,iBAAiB;QAC1B,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACvD,GAAG,IAAI;YACP,cAAc,EAAE,sBAAsB,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC;SAC5E,CAAC,CAAC;KACJ,CAAC,CAAC;AACL,CAAC,CAAC;AAhEW,QAAA,2BAA2B,+BAgEtC","sourcesContent":["import { GraphQLSchema, OperationTypeNode, type GraphQLObjectType, type OperationTypeDefinitionNode } from \"graphql\";\n\n/**\n * Per-server @hidden filtering can prune a root operation type (query/mutation/subscription) away while\n * the original explicit `schema {}` block still binds it. `printSchemaWithDirectives` then emits a\n * dangling binding (e.g. `mutation: Mutation` with no `type Mutation`), which fails stitching\n * composition with `Unknown type Mutation.`. A subgraph legitimately having no query or no mutation for\n * a server is fine — only the dangling reference is not.\n *\n * This rebinds each operation to a live, non-empty root type and rewrites the schema-definition AST so it\n * only lists operations whose root type is still live. Schema-level directives / extensions on that AST\n * are preserved (they live nowhere else), and any now-empty root type is dropped from the type map so we\n * never emit an empty `type X {}`. Returns the schema untouched when nothing dangles, keeping the common\n * case byte-for-byte identical.\n */\n\nconst isNonEmptyObjectType = (type: GraphQLObjectType | null | undefined): type is GraphQLObjectType =>\n type !== null && type !== undefined && Object.keys(type.getFields()).length > 0;\n\n// Operations still bound by the schema-definition AST (what astFromSchema would print).\nconst boundOperationsFromAst = (schema: GraphQLSchema): ReadonlySet<OperationTypeNode> => {\n const operations = new Set<OperationTypeNode>();\n const nodes = [schema.astNode, ...schema.extensionASTNodes];\n for (const node of nodes) {\n if (node === null || node === undefined) {\n continue;\n }\n for (const operationType of node.operationTypes ?? []) {\n operations.add(operationType.operation);\n }\n }\n return operations;\n};\n\n// Keep only the operation bindings whose root type is still live, dropping the dangling ones.\nconst liveOperationTypeNodes = (\n operationTypes: ReadonlyArray<OperationTypeDefinitionNode> | undefined,\n liveOperations: ReadonlySet<OperationTypeNode>\n): ReadonlyArray<OperationTypeDefinitionNode> =>\n (operationTypes ?? []).filter(operationType => liveOperations.has(operationType.operation));\n\nexport const reconcileRootOperationTypes = (schema: GraphQLSchema): GraphQLSchema => {\n const config = schema.toConfig();\n\n const liveQuery = isNonEmptyObjectType(config.query) ? config.query : undefined;\n const liveMutation = isNonEmptyObjectType(config.mutation) ? config.mutation : undefined;\n const liveSubscription = isNonEmptyObjectType(config.subscription) ? config.subscription : undefined;\n\n const emptiedAnOperation =\n liveQuery !== config.query || liveMutation !== config.mutation || liveSubscription !== config.subscription;\n\n const boundOperations = boundOperationsFromAst(schema);\n const hasDanglingBinding =\n (boundOperations.has(OperationTypeNode.QUERY) && liveQuery === undefined) ||\n (boundOperations.has(OperationTypeNode.MUTATION) && liveMutation === undefined) ||\n (boundOperations.has(OperationTypeNode.SUBSCRIPTION) && liveSubscription === undefined);\n\n // No emptied root and no dangling binding — leave the output identical.\n if (!emptiedAnOperation && !hasDanglingBinding) {\n return schema;\n }\n\n const liveOperations = new Set<OperationTypeNode>();\n if (liveQuery !== undefined) {\n liveOperations.add(OperationTypeNode.QUERY);\n }\n if (liveMutation !== undefined) {\n liveOperations.add(OperationTypeNode.MUTATION);\n }\n if (liveSubscription !== undefined) {\n liveOperations.add(OperationTypeNode.SUBSCRIPTION);\n }\n\n // Root types that are no longer live must leave the type map, otherwise an empty `type X {}` is printed.\n const deadRootTypeNames = new Set<string>();\n const markDeadRoot = (original: GraphQLObjectType | null | undefined, live: GraphQLObjectType | undefined): void => {\n if (original !== null && original !== undefined && live === undefined) {\n deadRootTypeNames.add(original.name);\n }\n };\n markDeadRoot(config.query, liveQuery);\n markDeadRoot(config.mutation, liveMutation);\n markDeadRoot(config.subscription, liveSubscription);\n\n const reconciledAstNode =\n config.astNode === null || config.astNode === undefined\n ? config.astNode\n : { ...config.astNode, operationTypes: liveOperationTypeNodes(config.astNode.operationTypes, liveOperations) };\n\n return new GraphQLSchema({\n ...config,\n query: liveQuery,\n mutation: liveMutation,\n subscription: liveSubscription,\n // Drop dead roots from the explicit type list. `new GraphQLSchema` re-collects any type still\n // referenced by a live field, so a former root that is also used as a field type survives as a\n // regular type — only the genuinely unreferenced root is removed.\n types: config.types.filter(type => !deadRootTypeNames.has(type.name)),\n // Keep schema-level directives/extensions; only strip operation entries whose root type is gone.\n astNode: reconciledAstNode,\n extensionASTNodes: config.extensionASTNodes.map(node => ({\n ...node,\n operationTypes: liveOperationTypeNodes(node.operationTypes, liveOperations),\n })),\n });\n};\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformer-chain.js","sourceRoot":"","sources":["../../../../../../libs/graphql/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,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC5D,OAAO,IAAA,iCAAyB,EAC9B,IAAA,qCAA6B,EAAC,MAAM,EAAE,WAAW,EAAE,EAAE,4BAA4B,EAAE,IAAI,EAAE,CAAC,CAC3F,CAAC;AACJ,CAAC,CAAC;AALW,QAAA,yBAAyB,6BAKpC","sourcesContent":["import { makeExecutableSchema } from \"@graphql-tools/schema\";\nimport { printSchemaWithDirectives } from \"@graphql-tools/utils\";\nimport type { GraphQLSchema } from \"graphql\";\nimport { authorizationDirective } from \"./authorization-directive\";\nimport { complexityDirective } from \"./complexity-directive\";\nimport { globalIdTransformer } from \"./global-id-transformer\";\nimport { hiddenDirective } from \"./hidden-directive\";\nimport { previewDirective } from \"./preview-directive\";\nimport { reconcileRootOperationTypes } from \"./reconcile-root-operation-types\";\n\nexport const graphqlGatewayNames = [\"internal\", \"public\", \"report\", \"v3-mobile\"] as const;\n\nexport type GraphqlGatewayName = (typeof graphqlGatewayNames)[number];\n\nexport type ApplySdlDirectiveTransformersOptions = {\n /**\n * Keep schema-stitching entry points (@merge / @computed fields) even when they are @hidden.\n * Enabled when rendering a single subgraph's SDL so a pure-stitch subgraph does not collapse to an\n * empty schema. The runtime gateway omits this so those internal fields stay hidden from users.\n */\n readonly preserveStitchingEntrypoints?: boolean;\n};\n\nexport const applySdlDirectiveTransformers = (\n schema: GraphQLSchema,\n gatewayName: GraphqlGatewayName,\n { preserveStitchingEntrypoints = false }: ApplySdlDirectiveTransformersOptions = {}\n): GraphQLSchema => {\n const { complexityDirectiveTransformer } = complexityDirective();\n const { previewDirectiveTransformer } = previewDirective();\n const { hiddenDirectiveTransformer } = hiddenDirective(gatewayName, { preserveStitchingEntrypoints });\n const { authorizationDirectiveTransformer } = authorizationDirective();\n const hiddenSchema = hiddenDirectiveTransformer(schema);\n const previewSchema = gatewayName === \"report\" ? hiddenSchema : previewDirectiveTransformer(hiddenSchema);\n\n const transformedSchema = authorizationDirectiveTransformer(\n complexityDirectiveTransformer(globalIdTransformer(previewSchema))\n );\n\n // Drop dangling/empty root operations left when @hidden empties a root type. Complements\n // preserveStitchingEntrypoints, which only rescues roots whose fields carry a stitching directive.\n return reconcileRootOperationTypes(transformedSchema);\n};\n\nexport const applyDirectiveTransformers = applySdlDirectiveTransformers;\n\nexport const buildTransformedSchemaSdl = (gatewayName: GraphqlGatewayName, inputSdl: string): string => {\n const schema = makeExecutableSchema({ typeDefs: inputSdl });\n return printSchemaWithDirectives(\n applySdlDirectiveTransformers(schema, gatewayName, { preserveStitchingEntrypoints: true })\n );\n};\n"]}
|