@nxgt/graphql-codegen-msw 0.1.2 → 0.2.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/README.md CHANGED
@@ -169,8 +169,11 @@ non-null type, a wrong type, an unknown enum value or input field, an Int
169
169
  beyond 32 bits, a value a custom scalar refuses) is answered as graphql-yoga
170
170
  answers it, whatever `invalidInput` is: status 400, one plain error per
171
171
  problem in graphql 17's wording, types named and "Did you mean …?" included,
172
- no `extensions`. The generated file describes the input types from the schema
173
- for it. The few cases where the mock still differs are listed in
172
+ no `extensions` (except a value a `zodScalar` refuses, which carries the
173
+ scalar's own `{ code: 'INVALID_SCALAR', scalar, reason }`, as
174
+ [`@nxgt/graphql-scalars`](https://www.npmjs.com/package/@nxgt/graphql-scalars)
175
+ puts it on the server). The generated file describes the input types from the
176
+ schema for it. The few cases where the mock still differs are listed in
174
177
  [the handlers guide](./docs/guide/handlers.md#known-differences).
175
178
 
176
179
  ```json
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/coercion/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,qBAAqB,EAA0B,MAAM,SAAS,CAAC;AAE7E,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAGN,KAAK,UAAU,EAEf,MAAM,YAAY,CAAC;AAKpB,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,sEAAsE;AACtE,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC,uEAAuE;IACvE,QAAQ,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;IACtE,QAAQ,CAAC,UAAU,CAA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wBAAgB,cAAc,CAC7B,MAAM,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,EACnC,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,iBAAiB,GAC1B,qBAAqB,EAAE,CAezB"}
@@ -13,11 +13,14 @@ export declare function builtinRefusal(name: string, value: unknown): string | u
13
13
  /** Why the enum `name` refuses `value`, with graphql's suggestions. */
14
14
  export declare function enumRefusal(name: string, values: readonly string[], value: unknown): string | undefined;
15
15
  /**
16
- * Why a custom scalar refuses the value, as a scalar built with
17
- * `zodScalar` (`@nxgt/graphql-scalars`) words it: its schema's first issue,
18
- * which the client's schema, the same one, reports too.
16
+ * Why a custom scalar refuses the value, and the `extensions` it carries, as
17
+ * a scalar built with `zodScalar` (`@nxgt/graphql-scalars`) words it: its
18
+ * schema's first issue, which the client's schema, the same one, reports too.
19
19
  */
20
- export declare function scalarRefusal(name: string, issue: z.core.$ZodIssue | undefined): string | undefined;
20
+ export declare function scalarRefusal(name: string, issue: z.core.$ZodIssue | undefined): {
21
+ reason: string;
22
+ extensions: Record<string, unknown>;
23
+ } | undefined;
21
24
  /** The input object messages, by what is wrong with the object. */
22
25
  export declare const objectRefusal: {
23
26
  notAnObject: (type: string, value: unknown) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/runtime/coercion/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQ7B,4EAA4E;AAC5E,wBAAgB,cAAc,CAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACZ,MAAM,GAAG,SAAS,CAwBpB;AAWD,uEAAuE;AACvE,wBAAgB,WAAW,CAC1B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,KAAK,EAAE,OAAO,GACZ,MAAM,GAAG,SAAS,CAOpB;AAMD;;;;GAIG;AACH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nE,eAAO,MAAM,aAAa;wBACL,MAAM,SAAS,OAAO;yBAErB,MAAM,SAAS,MAAM,UAAU,OAAO;yBAGpD,MAAM,SACL,MAAM,SACN,SAAS,MAAM,EAAE,UAChB,OAAO;kBAKF,MAAM;wBAEA,MAAM;mBAEX,MAAM;CAErB,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,eAAe;wBACP,MAAM,QAAQ,MAAM;mBAEzB,MAAM,QAAQ,MAAM;IAEnC,2EAA2E;yBAEpE,MAAM,SACL,OAAO,QACR,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,UAC1B,MAAM;CAQf,CAAC"}
@@ -15,6 +15,8 @@ export interface Problem {
15
15
  readonly path: Path;
16
16
  readonly value: unknown;
17
17
  readonly reason: string;
18
+ /** What the refusing scalar puts in its error's `extensions`. */
19
+ readonly extensions?: Record<string, unknown>;
18
20
  }
19
21
  /** What a walk reads, and the problems it found so far. */
20
22
  export interface Walk {
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/runtime/coercion/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EAGN,KAAK,UAAU,EAEf,KAAK,OAAO,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAQrD,KAAK,IAAI,GAAG,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;AAGzC,kEAAkE;AAClE,MAAM,WAAW,OAAO;IACvB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAED,2DAA2D;AAC3D,MAAM,WAAW,IAAI;IACpB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IACxC,Q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B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;CACvB;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,CAC5B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,OAAO,EACb,EAAE,EAAE,EAAE,GACJ,IAAI,CAcN;AAgED,uEAAuE;AACvE,eAAO,MAAM,UAAU,iHACwF,CAAC"}
@@ -347,7 +347,10 @@ function suggest(value, values) {
347
347
  return didYouMean(suggestionList(value, values), "the enum value");
348
348
  }
349
349
  function scalarRefusal(name, issue) {
350
- return issue && `${name} cannot represent this input: ${issue.message}`;
350
+ return issue && {
351
+ reason: `${name} cannot represent this input: ${issue.message}`,
352
+ extensions: { code: "INVALID_SCALAR", scalar: name, reason: issue.code }
353
+ };
351
354
  }
352
355
  var objectRefusal = {
353
356
  notAnObject: (type, value) => `Expected value of type "${type}" to be an object, found: ${crossInspect(value)}.`,
@@ -418,22 +421,25 @@ function validateNamed(walk, value, name, at) {
418
421
  validateObject(walk, value, name, named, at);
419
422
  return;
420
423
  }
421
- const reason = leafRefusal(walk, value, name, named, at);
422
- if (reason !== undefined)
423
- report(walk, at, value, reason);
424
+ const refusal = leafRefusal(walk, value, name, named, at);
425
+ if (refusal !== undefined)
426
+ report(walk, at, value, refusal.reason, refusal.extensions);
424
427
  }
425
428
  function leafRefusal(walk, value, name, named, at) {
426
429
  switch (named.kind) {
427
430
  case "builtin":
428
- return builtinRefusal(name, value);
431
+ return plain(builtinRefusal(name, value));
429
432
  case "enum":
430
- return enumRefusal(name, named.values, value);
433
+ return plain(enumRefusal(name, named.values, value));
431
434
  case "scalar":
432
435
  return scalarRefusal(name, issueAt(walk.issues, at.zodPath));
433
436
  default:
434
437
  throw new Error(STALE_FILE);
435
438
  }
436
439
  }
440
+ function plain(reason) {
441
+ return reason === undefined ? undefined : { reason };
442
+ }
437
443
  var STALE_FILE = "@nxgt/graphql-codegen-msw: the generated file was written by another version than the runtime; regenerate it";
438
444
  function validateObject(walk, value, name, type, at) {
439
445
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
@@ -472,8 +478,13 @@ function validateOneOf(walk, object, name, known, at) {
472
478
  else if (object[only] === null)
473
479
  report(walk, { ...at, path: [...at.path, only] }, object, objectRefusal.oneOf(name));
474
480
  }
475
- function report(walk, at, value, reason) {
476
- walk.problems.push({ path: at.path, value, reason });
481
+ function report(walk, at, value, reason, extensions) {
482
+ walk.problems.push({
483
+ path: at.path,
484
+ value,
485
+ reason,
486
+ ...extensions === undefined ? {} : { extensions }
487
+ });
477
488
  }
478
489
 
479
490
  // src/runtime/coercion/index.ts
@@ -487,20 +498,26 @@ function coercionErrors(issues, request, operation) {
487
498
  types: inputTypes,
488
499
  issues: walked,
489
500
  problems: []
490
- }).map((message) => located(message, definitions.get(name))));
501
+ }).map((refused) => located(refused, definitions.get(name))));
491
502
  }
492
503
  function variableMessages(name, source, sent, walk) {
493
504
  const { type, hasDefault } = declared(source);
494
505
  if (!Object.hasOwn(sent, name))
495
- return type.kind === "non-null" && !hasDefault ? [variableRefusal.notProvided(name, printType(type))] : [];
506
+ return type.kind === "non-null" && !hasDefault ? [{ message: variableRefusal.notProvided(name, printType(type)) }] : [];
496
507
  const value = sent[name];
497
508
  if (value === null && type.kind === "non-null")
498
- return [variableRefusal.isNull(name, printType(type))];
509
+ return [{ message: variableRefusal.isNull(name, printType(type)) }];
499
510
  validateValue(walk, value, type, { path: [], zodPath: [name] });
500
- return walk.problems.map(({ path, value: found, reason }) => variableRefusal.invalidValue(name, found, path, reason));
511
+ return walk.problems.map(({ path, value: found, reason, extensions }) => ({
512
+ message: variableRefusal.invalidValue(name, found, path, reason),
513
+ ...extensions === undefined ? {} : { extensions }
514
+ }));
501
515
  }
502
- function located(message, definition) {
503
- return new GraphQLError(message, definition ? { nodes: definition } : {}).toJSON();
516
+ function located({ message, extensions }, definition) {
517
+ return new GraphQLError(message, {
518
+ ...definition ? { nodes: definition } : {},
519
+ ...extensions === undefined ? {} : { extensions }
520
+ }).toJSON();
504
521
  }
505
522
 
506
523
  // src/runtime/response.ts
@@ -591,5 +608,5 @@ export {
591
608
  mockOperation
592
609
  };
593
610
 
594
- //# debugId=A8F75623BD88F85364756E2164756E21
611
+ //# debugId=A78B80C245DE4C5F64756E2164756E21
595
612
  //# sourceMappingURL=index.js.map
@@ -4,18 +4,18 @@
4
4
  "sourcesContent": [
5
5
  "// What an `invalidInput` of your own builds its answer with, from\n// `@nxgt/graphql-validation`, so an application needs no direct import of it.\nexport {\n\ttype FieldError,\n\ttype FieldIssue,\n\tfieldIssueOf,\n\tfieldsError,\n\tinputPath,\n\tinvalidInputError,\n\ttype Translate,\n} from '@nxgt/graphql-validation';\nexport type { InputType, InputTypes } from './coercion';\nexport {\n\ttype GraphQLMockInfo,\n\ttype GraphQLMockResolver,\n\ttype MockedOperation,\n\ttype MockOptions,\n\tmockOperation,\n} from './mock-operation';\nexport {\n\tbadUserInputRefusal,\n\ttype InvalidInput,\n\ttype InvalidInputAnswer,\n\tinvalidInputRefusal,\n\ttype RefusedOperation,\n} from './refusals';\nexport {\n\ttype AnyGraphQLError,\n\terrorResponse,\n\tisGraphQLError,\n} from './response';\n",
6
6
  "import type {\n\tPath,\n\tRequestHandlerOptions,\n\tResponseResolverInfo,\n\tResponseResolverReturnType,\n} from 'msw';\nimport {\n\ttype GraphQLHandler,\n\ttype GraphQLQuery,\n\ttype GraphQLResponseBody,\n\ttype GraphQLVariables,\n\tgraphql,\n} from 'msw/graphql';\nimport type { z } from 'zod';\nimport { COERCION_STATUS, coercionErrors, type InputTypes } from './coercion';\nimport type { InvalidInput } from './refusals';\nimport { errorResponse, isGraphQLError } from './response';\n\n/**\n * What a resolver receives: msw's own resolver info for a GraphQL\n * operation (`variables`, `query`, `operationName`, `request`, `cookies`,\n * `requestId`, `finalize`), `variables` typed with the operation's\n * variables type. They are the variables as sent: checked, not parsed.\n */\nexport type GraphQLMockInfo<Variables extends GraphQLVariables> =\n\tResponseResolverInfo<{\n\t\tquery: string;\n\t\toperationName: string;\n\t\tvariables: Variables;\n\t\tcookies: Record<string, string>;\n\t}>;\n\n/**\n * A handler's resolver, as msw's `graphql.link(...).query(name, resolver)`\n * takes one, without its generator form: return\n * `HttpResponse.json({ data })`, an `errorResponse(...)`, or nothing to\n * let the next handler answer; throw a `GraphQLError` to answer with it.\n */\nexport type GraphQLMockResolver<\n\tResult extends GraphQLQuery,\n\tVariables extends GraphQLVariables,\n> = (\n\tinfo: GraphQLMockInfo<Variables>,\n) =>\n\t| ResponseResolverReturnType<GraphQLResponseBody<Result>>\n\t| Promise<ResponseResolverReturnType<GraphQLResponseBody<Result>>>;\n\n/** A handler's options: msw's (`once`), and an endpoint for this handler only. */\nexport interface MockOptions extends RequestHandlerOptions {\n\t/** Overrides the generated `endpoint` for this handler: a URL or a path msw matches. */\n\treadonly endpoint?: Path;\n}\n\n/** One operation, as the generated file describes it. */\nexport interface MockedOperation {\n\treadonly type: 'query' | 'mutation';\n\t/** The operation's name in the document: `SignUp`. */\n\treadonly name: string;\n\t/** The variables' schema, from `@nxgt/graphql-codegen-zod`: `zSignUpMutationVariables`. */\n\treadonly variables: z.ZodType;\n\t/**\n\t * Each variable's GraphQL type, with its default: `{ first: \"Int = 10\" }`.\n\t * Internal: written by the plugin for the coercion answer, its form may\n\t * change in any version together with the generated file. Defaults to\n\t * `{}`: no variable is walked, and every refusal goes to `invalidInput`.\n\t */\n\treadonly variableTypes?: Readonly<Record<string, string>> | undefined;\n\t/**\n\t * The input types the variables reach, from the schema. Internal, as\n\t * `variableTypes`; defaults to `{}`.\n\t */\n\treadonly inputTypes?: InputTypes | undefined;\n\treadonly endpoint: Path;\n\treadonly invalidInput: InvalidInput;\n}\n\n/**\n * An msw handler for one operation: `graphql.link(endpoint)`'s `query` or\n * `mutation` by the operation's name. Its variables are checked with the\n * operation's schema first, without calling `resolver` when they fail: a\n * value graphql refuses while coercing the variables (missing, null, of\n * the wrong type, an unknown enum value or field, an Int beyond 32 bits, a\n * value a custom scalar refuses) is answered as graphql-yoga answers it\n * (`coercionErrors`, status 400), whatever `invalidInput` is; any other\n * invalid input with `invalidInput`'s error and status. A `GraphQLError`\n * the resolver throws is answered as `errorResponse` answers it; anything\n * else it throws is msw's to answer (a 500).\n */\nexport function mockOperation<\n\tResult extends GraphQLQuery,\n\tVariables extends GraphQLVariables,\n>(\n\toperation: MockedOperation,\n\tresolver: GraphQLMockResolver<Result, Variables>,\n\toptions: MockOptions = {},\n): GraphQLHandler {\n\tconst { endpoint = operation.endpoint, ...handlerOptions } = options;\n\tconst link = graphql.link(endpoint);\n\tconst where = { type: operation.type, name: operation.name };\n\treturn link[operation.type](\n\t\toperation.name,\n\t\tasync (info) => {\n\t\t\tconst checked = await operation.variables.safeParseAsync(info.variables);\n\t\t\tif (!checked.success) {\n\t\t\t\tconst { issues } = checked.error;\n\t\t\t\t// The API refuses these while coercing the variables, before\n\t\t\t\t// its own validation: whatever invalidInput says.\n\t\t\t\tconst refused = coercionErrors(issues, info, operation);\n\t\t\t\tif (refused.length > 0)\n\t\t\t\t\treturn errorResponse(refused, { status: COERCION_STATUS });\n\t\t\t\t// A status no response can carry is ignored, as errorResponse\n\t\t\t\t// ignores it: the error's own, else 200.\n\t\t\t\tconst { error, status } = await operation.invalidInput(issues, where);\n\t\t\t\treturn errorResponse(error, { status });\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst answer = await resolver(info as GraphQLMockInfo<Variables>);\n\t\t\t\tassertNotIterator(answer, operation.name);\n\t\t\t\treturn answer;\n\t\t\t} catch (error) {\n\t\t\t\tif (isGraphQLError(error)) return errorResponse(error);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\t\thandlerOptions,\n\t);\n}\n\n/**\n * msw would keep a generator's iterator and answer the next requests from\n * it without calling this handler's resolver again, so their variables would\n * go unchecked: refused instead.\n */\nfunction assertNotIterator(answer: unknown, name: string): void {\n\tif (\n\t\ttypeof answer === 'object' &&\n\t\tanswer !== null &&\n\t\t!(answer instanceof Response) &&\n\t\ttypeof (answer as { next?: unknown }).next === 'function'\n\t) {\n\t\tthrow new TypeError(\n\t\t\t`@nxgt/graphql-codegen-msw: the resolver of ${name} returned an iterator (a generator function?). Each request's variables are checked before the resolver runs, which msw cannot do once it keeps an iterator: answer each request from a plain function, or register one handler per answer with { once: true }.`,\n\t\t);\n\t}\n}\n",
7
- "// What graphql-yoga refuses while it coerces the variables, before any\n// resolver runs: a missing or null value for a non-null type, a value of the\n// wrong type, an unknown enum value, an unknown input field, an Int beyond\n// 32 bits, a value a custom scalar refuses. Measured on graphql-yoga 5.24\n// (@graphql-tools/executor 2, graphql 17): one error per problem,\n// `{ message, locations }` and no extensions, status 400 whatever the\n// Accept header.\n//\n// How coercion is decided: the variables are walked as graphql walks them\n// (`validate.ts`), over the input types the generated file describes from\n// the schema. A built-in scalar, an enum, an input object and the non-null\n// and list wrappers are judged as graphql judges them, from the declared\n// type and the value sent, never from a Zod issue; a custom scalar refuses\n// exactly where the operation's Zod schema has an issue at its position.\n// So the answer is graphql-yoga's whenever graphql would refuse, and empty\n// otherwise, when the issues are the API's own validation.\nimport type { GraphQLFormattedError, VariableDefinitionNode } from 'graphql';\nimport { GraphQLError } from 'graphql';\nimport type { z } from 'zod';\nimport {\n\tdeclared,\n\tdefinitionsOf,\n\ttype InputTypes,\n\tprintType,\n} from './document';\nimport { placed } from './issues';\nimport { variableRefusal } from './messages';\nimport { type Problem, validateValue, type Walk } from './validate';\n\nexport type { InputType, InputTypes } from './document';\nexport { STALE_FILE } from './validate';\n\n/** The status graphql-yoga answers a variable coercion error with. */\nexport const COERCION_STATUS = 400;\n\n/**\n * What the generated file says of an operation's variables. Without them\n * (a hand-written handler), no variable is walked.\n */\nexport interface DeclaredVariables {\n\t/** Each variable's type, with its default: `{ first: \"Int = 10\" }`. */\n\treadonly variableTypes?: Readonly<Record<string, string>> | undefined;\n\treadonly inputTypes?: InputTypes | undefined;\n}\n\n/** The request whose variables the operation's schema refused. */\nexport interface CoercedRequest {\n\treadonly query: string;\n\treadonly operationName: string;\n\treadonly variables: unknown;\n}\n\n/**\n * The errors graphql-yoga answers the request's variables with, in its\n * order (variables in declaration order, an object's fields in the\n * schema's, unknown fields last), each located at the variable's\n * definition in the query sent; empty when graphql takes every variable.\n */\nexport function coercionErrors(\n\tissues: readonly z.core.$ZodIssue[],\n\trequest: CoercedRequest,\n\toperation: DeclaredVariables,\n): GraphQLFormattedError[] {\n\tconst definitions = definitionsOf(request.query, request.operationName);\n\tconst sent =\n\t\ttypeof request.variables === 'object' && request.variables !== null\n\t\t\t? (request.variables as Record<string, unknown>)\n\t\t\t: {};\n\tconst walked = placed(issues);\n\tconst { variableTypes = {}, inputTypes = {} } = operation;\n\treturn Object.entries(variableTypes).flatMap(([name, source]) =>\n\t\tvariableMessages(name, source, sent, {\n\t\t\ttypes: inputTypes,\n\t\t\tissues: walked,\n\t\t\tproblems: [],\n\t\t}).map((message) => located(message, definitions.get(name))),\n\t);\n}\n\n/** One variable's messages, as @graphql-tools/executor's `getVariableValues` words them. */\nfunction variableMessages(\n\tname: string,\n\tsource: string,\n\tsent: Record<string, unknown>,\n\twalk: Walk,\n): string[] {\n\tconst { type, hasDefault } = declared(source);\n\tif (!Object.hasOwn(sent, name))\n\t\treturn type.kind === 'non-null' && !hasDefault\n\t\t\t? [variableRefusal.notProvided(name, printType(type))]\n\t\t\t: [];\n\tconst value = sent[name];\n\tif (value === null && type.kind === 'non-null')\n\t\treturn [variableRefusal.isNull(name, printType(type))];\n\tvalidateValue(walk, value, type, { path: [], zodPath: [name] });\n\treturn walk.problems.map(({ path, value: found, reason }: Problem) =>\n\t\tvariableRefusal.invalidValue(name, found, path, reason),\n\t);\n}\n\nfunction located(\n\tmessage: string,\n\tdefinition: VariableDefinitionNode | undefined,\n): GraphQLFormattedError {\n\treturn new GraphQLError(\n\t\tmessage,\n\t\tdefinition ? { nodes: definition } : {},\n\t).toJSON();\n}\n",
7
+ "// What graphql-yoga refuses while it coerces the variables, before any\n// resolver runs: a missing or null value for a non-null type, a value of the\n// wrong type, an unknown enum value, an unknown input field, an Int beyond\n// 32 bits, a value a custom scalar refuses. Measured on graphql-yoga 5.24\n// (@graphql-tools/executor 2, graphql 17): one error per problem,\n// `{ message, locations }`, status 400 whatever the Accept header. Only a\n// custom scalar's refusal has `extensions`: the `INVALID_SCALAR` ones\n// `zodScalar` puts in its error, which graphql keeps on the variable's.\n//\n// How coercion is decided: the variables are walked as graphql walks them\n// (`validate.ts`), over the input types the generated file describes from\n// the schema. A built-in scalar, an enum, an input object and the non-null\n// and list wrappers are judged as graphql judges them, from the declared\n// type and the value sent, never from a Zod issue; a custom scalar refuses\n// exactly where the operation's Zod schema has an issue at its position.\n// So the answer is graphql-yoga's whenever graphql would refuse, and empty\n// otherwise, when the issues are the API's own validation.\nimport type { GraphQLFormattedError, VariableDefinitionNode } from 'graphql';\nimport { GraphQLError } from 'graphql';\nimport type { z } from 'zod';\nimport {\n\tdeclared,\n\tdefinitionsOf,\n\ttype InputTypes,\n\tprintType,\n} from './document';\nimport { placed } from './issues';\nimport { variableRefusal } from './messages';\nimport { type Problem, validateValue, type Walk } from './validate';\n\nexport type { InputType, InputTypes } from './document';\nexport { STALE_FILE } from './validate';\n\n/** The status graphql-yoga answers a variable coercion error with. */\nexport const COERCION_STATUS = 400;\n\n/**\n * What the generated file says of an operation's variables. Without them\n * (a hand-written handler), no variable is walked.\n */\nexport interface DeclaredVariables {\n\t/** Each variable's type, with its default: `{ first: \"Int = 10\" }`. */\n\treadonly variableTypes?: Readonly<Record<string, string>> | undefined;\n\treadonly inputTypes?: InputTypes | undefined;\n}\n\n/** The request whose variables the operation's schema refused. */\nexport interface CoercedRequest {\n\treadonly query: string;\n\treadonly operationName: string;\n\treadonly variables: unknown;\n}\n\n/**\n * The errors graphql-yoga answers the request's variables with, in its\n * order (variables in declaration order, an object's fields in the\n * schema's, unknown fields last), each located at the variable's\n * definition in the query sent; empty when graphql takes every variable.\n */\nexport function coercionErrors(\n\tissues: readonly z.core.$ZodIssue[],\n\trequest: CoercedRequest,\n\toperation: DeclaredVariables,\n): GraphQLFormattedError[] {\n\tconst definitions = definitionsOf(request.query, request.operationName);\n\tconst sent =\n\t\ttypeof request.variables === 'object' && request.variables !== null\n\t\t\t? (request.variables as Record<string, unknown>)\n\t\t\t: {};\n\tconst walked = placed(issues);\n\tconst { variableTypes = {}, inputTypes = {} } = operation;\n\treturn Object.entries(variableTypes).flatMap(([name, source]) =>\n\t\tvariableMessages(name, source, sent, {\n\t\t\ttypes: inputTypes,\n\t\t\tissues: walked,\n\t\t\tproblems: [],\n\t\t}).map((refused) => located(refused, definitions.get(name))),\n\t);\n}\n\n/** One variable's messages, as @graphql-tools/executor's `getVariableValues` words them. */\nfunction variableMessages(\n\tname: string,\n\tsource: string,\n\tsent: Record<string, unknown>,\n\twalk: Walk,\n): Refused[] {\n\tconst { type, hasDefault } = declared(source);\n\tif (!Object.hasOwn(sent, name))\n\t\treturn type.kind === 'non-null' && !hasDefault\n\t\t\t? [{ message: variableRefusal.notProvided(name, printType(type)) }]\n\t\t\t: [];\n\tconst value = sent[name];\n\tif (value === null && type.kind === 'non-null')\n\t\treturn [{ message: variableRefusal.isNull(name, printType(type)) }];\n\tvalidateValue(walk, value, type, { path: [], zodPath: [name] });\n\treturn walk.problems.map(\n\t\t({ path, value: found, reason, extensions }: Problem) => ({\n\t\t\tmessage: variableRefusal.invalidValue(name, found, path, reason),\n\t\t\t...(extensions === undefined ? {} : { extensions }),\n\t\t}),\n\t);\n}\n\n/** One refusal: its message, and the `extensions` a custom scalar's error carries. */\ninterface Refused {\n\treadonly message: string;\n\treadonly extensions?: Record<string, unknown>;\n}\n\nfunction located(\n\t{ message, extensions }: Refused,\n\tdefinition: VariableDefinitionNode | undefined,\n): GraphQLFormattedError {\n\treturn new GraphQLError(message, {\n\t\t...(definition ? { nodes: definition } : {}),\n\t\t...(extensions === undefined ? {} : { extensions }),\n\t}).toJSON();\n}\n",
8
8
  "import {\n\tKind,\n\ttype OperationDefinitionNode,\n\tparse,\n\ttype VariableDefinitionNode,\n} from 'graphql';\n\n/**\n * One GraphQL type the variables reach, as the generated file describes it\n * from the schema: a built-in scalar (`String`, `Int`, `Float`, `Boolean`,\n * `ID`), a custom scalar, an enum and its values, or an input object and\n * the type of each field (`\"[String!]\"`, `\"Int! = 1\"` with a default).\n *\n * Internal: written by the plugin and read by the coercion answer only. Its\n * form may change in any version, together with the generated file.\n */\nexport type InputType =\n\t| { readonly kind: 'builtin' }\n\t| { readonly kind: 'scalar' }\n\t| { readonly kind: 'enum'; readonly values: readonly string[] }\n\t| {\n\t\t\treadonly kind: 'input';\n\t\t\treadonly fields: Readonly<Record<string, string>>;\n\t\t\treadonly oneOf?: true;\n\t };\n\n/** The input types of one generated file, by name. Internal, as `InputType`. */\nexport type InputTypes = Readonly<Record<string, InputType>>;\n\n/** A type as graphql-js walks it: non-null and list wrappers around a name. */\nexport type TypeRef =\n\t| { readonly kind: 'non-null'; readonly of: TypeRef }\n\t| { readonly kind: 'list'; readonly of: TypeRef }\n\t| { readonly kind: 'named'; readonly name: string };\n\n/** A variable's or an input field's declaration: its type, and whether it has a default. */\nexport interface Declared {\n\treadonly type: TypeRef;\n\treadonly hasDefault: boolean;\n}\n\n/** `\"[Int!]! = [1]\"` read: the type before ` = `, a default after it. */\nexport function declared(source: string): Declared {\n\tconst at = source.indexOf(' = ');\n\tconst printed = at === -1 ? source : source.slice(0, at);\n\treturn { type: typeRef(printed.trim()), hasDefault: at !== -1 };\n}\n\nfunction typeRef(printed: string): TypeRef {\n\tif (printed.endsWith('!'))\n\t\treturn { kind: 'non-null', of: typeRef(printed.slice(0, -1)) };\n\tif (printed.startsWith('[') && printed.endsWith(']'))\n\t\treturn { kind: 'list', of: typeRef(printed.slice(1, -1)) };\n\treturn { kind: 'named', name: printed };\n}\n\n/** A type as graphql-js prints it in a message: `[Int!]!`. */\nexport function printType(type: TypeRef): string {\n\tswitch (type.kind) {\n\t\tcase 'non-null':\n\t\t\treturn `${printType(type.of)}!`;\n\t\tcase 'list':\n\t\t\treturn `[${printType(type.of)}]`;\n\t\tdefault:\n\t\t\treturn type.name;\n\t}\n}\n\n/**\n * The variables' definitions of the operation named `name` in the query the\n * client sent, by variable: where each error is located. Empty when the\n * query does not parse.\n */\nexport function definitionsOf(\n\tquery: string,\n\tname: string,\n): ReadonlyMap<string, VariableDefinitionNode> {\n\tlet operations: OperationDefinitionNode[];\n\ttry {\n\t\toperations = parse(query).definitions.filter(\n\t\t\t(node): node is OperationDefinitionNode =>\n\t\t\t\tnode.kind === Kind.OPERATION_DEFINITION,\n\t\t);\n\t} catch {\n\t\treturn new Map();\n\t}\n\tconst operation =\n\t\toperations.find((node) => node.name?.value === name) ?? operations[0];\n\treturn new Map(\n\t\t(operation?.variableDefinitions ?? []).map((node) => [\n\t\t\tnode.variable.name.value,\n\t\t\tnode,\n\t\t]),\n\t);\n}\n",
9
9
  "import type { z } from 'zod';\n\n/** A Zod issue and its whole path inside the variables. */\nexport interface PlacedIssue {\n\treadonly path: readonly (string | number)[];\n\treadonly issue: z.core.$ZodIssue;\n}\n\n/**\n * Every issue with its whole path, a union's own issue followed by each of\n * its branches' (`@oneOf` and nested unions): a custom scalar's refusal may\n * sit in either branch. A list's item issues come from the pipe after its\n * shaping union, outside any union.\n */\nexport function placed(\n\tissues: readonly z.core.$ZodIssue[],\n\tprefix: readonly (string | number)[] = [],\n): PlacedIssue[] {\n\treturn issues.flatMap((issue) => {\n\t\tconst path = [...prefix, ...issue.path.map(segment)];\n\t\tconst own = { path, issue };\n\t\tif (issue.code !== 'invalid_union') return [own];\n\t\treturn [own, ...issue.errors.flatMap((branch) => placed(branch, path))];\n\t});\n}\n\nfunction segment(key: PropertyKey): string | number {\n\treturn typeof key === 'number' ? key : String(key);\n}\n\n/**\n * The first issue at `path` or below it: what a custom scalar's schema\n * refused there. A scalar built with `zodScalar` refuses with its schema's\n * first issue, which the client's schema, the same one, reports first too.\n */\nexport function issueAt(\n\tissues: readonly PlacedIssue[],\n\tpath: readonly (string | number)[],\n): z.core.$ZodIssue | undefined {\n\treturn issues.find(\n\t\t(placedIssue) =>\n\t\t\tplacedIssue.path.length >= path.length &&\n\t\t\tpath.every((key, index) => placedIssue.path[index] === key),\n\t)?.issue;\n}\n",
10
10
  "/*!\n * Ported from cross-inspect 1.0.1 (packages/inspect),\n * https://github.com/ardatan/graphql-tools\n * Copyright (c) 2020 The Guild, Inc.\n * itself taken from graphql-js, https://github.com/graphql/graphql-js\n * Copyright (c) GraphQL Contributors\n * @license MIT\n */\n\n/**\n * A value as @graphql-tools/executor prints it in the messages it words\n * itself (the input objects' and the variable's prefix), through\n * `cross-inspect`: a string quoted, `{ a: 1, b: \"x\" }`, `[1, 2]`, `{}` and\n * `[]`, `[Object]` or `[Array]` beyond three levels, and every item of a\n * list. The variables come from JSON, so no function, error or cycle\n * reaches it: those branches of cross-inspect are left out. graphql's own\n * messages print with graphql's `inspect` (`inspect.ts`).\n */\nexport function crossInspect(value: unknown): string {\n\treturn formatValue(value, 0);\n}\n\nconst MAX_DEPTH = 3;\n\nfunction formatValue(value: unknown, depth: number): string {\n\tif (typeof value === 'string') return JSON.stringify(value);\n\tif (typeof value !== 'object' || value === null) return String(value);\n\tif (Array.isArray(value)) {\n\t\tif (value.length === 0) return '[]';\n\t\tif (depth >= MAX_DEPTH) return '[Array]';\n\t\treturn `[${value.map((item) => formatValue(item, depth + 1)).join(', ')}]`;\n\t}\n\tconst entries = Object.entries(value);\n\tif (entries.length === 0) return '{}';\n\tif (depth >= MAX_DEPTH) return '[Object]';\n\treturn `{ ${entries\n\t\t.map(([key, item]) => `${key}: ${formatValue(item, depth + 1)}`)\n\t\t.join(', ')} }`;\n}\n",
11
11
  "/*!\n * Ported from graphql-js 17.0.2 (src/jsutils/inspect.ts),\n * https://github.com/graphql/graphql-js\n * Copyright (c) GraphQL Contributors\n * @license MIT\n */\n\n// graphql-js's own `inspect`, ported line for line: what graphql prints in\n// the messages it words itself (the built-in scalars', an enum's, and the\n// value an enum suggestion is read from). Two levels deep, then `[Object]`\n// or `[Array]`; ten items of a list, then `... N more items`. The executor's\n// messages print with `cross-inspect` instead (`cross-inspect.ts`).\n\nconst MAX_ARRAY_LENGTH = 10;\nconst MAX_RECURSIVE_DEPTH = 2;\n\n/** A value as graphql-js prints it in an error message. */\nexport function inspect(value: unknown): string {\n\treturn formatValue(value, []);\n}\n\nfunction formatValue(value: unknown, seenValues: readonly unknown[]): string {\n\tswitch (typeof value) {\n\t\tcase 'string':\n\t\t\treturn JSON.stringify(value);\n\t\tcase 'function':\n\t\t\treturn value.name ? `[function ${value.name}]` : '[function]';\n\t\tcase 'object':\n\t\t\treturn formatObjectValue(value, seenValues);\n\t\tdefault:\n\t\t\treturn String(value);\n\t}\n}\n\nfunction formatObjectValue(\n\tvalue: object | null,\n\tpreviouslySeenValues: readonly unknown[],\n): string {\n\tif (value === null) {\n\t\treturn 'null';\n\t}\n\tif (previouslySeenValues.includes(value)) {\n\t\treturn '[Circular]';\n\t}\n\tconst seenValues = [...previouslySeenValues, value];\n\tif (isJSONable(value)) {\n\t\tconst jsonValue = value.toJSON();\n\t\t// check for infinite recursion\n\t\tif (jsonValue !== value) {\n\t\t\treturn typeof jsonValue === 'string'\n\t\t\t\t? jsonValue\n\t\t\t\t: formatValue(jsonValue, seenValues);\n\t\t}\n\t} else if (Array.isArray(value)) {\n\t\treturn formatArray(value, seenValues);\n\t}\n\treturn formatObject(value, seenValues);\n}\n\nfunction isJSONable(value: object): value is { toJSON: () => unknown } {\n\treturn typeof (value as { toJSON?: unknown }).toJSON === 'function';\n}\n\nfunction formatObject(object: object, seenValues: readonly unknown[]): string {\n\tconst entries = Object.entries(object);\n\tif (entries.length === 0) {\n\t\treturn '{}';\n\t}\n\tif (seenValues.length > MAX_RECURSIVE_DEPTH) {\n\t\treturn `[${getObjectTag(object)}]`;\n\t}\n\tconst properties = entries.map(\n\t\t([key, value]) => `${key}: ${formatValue(value, seenValues)}`,\n\t);\n\treturn `{ ${properties.join(', ')} }`;\n}\n\nfunction formatArray(\n\tarray: readonly unknown[],\n\tseenValues: readonly unknown[],\n): string {\n\tif (array.length === 0) {\n\t\treturn '[]';\n\t}\n\tif (seenValues.length > MAX_RECURSIVE_DEPTH) {\n\t\treturn '[Array]';\n\t}\n\tconst len = Math.min(MAX_ARRAY_LENGTH, array.length);\n\tconst remaining = array.length - len;\n\tconst items: string[] = [];\n\tfor (let i = 0; i < len; ++i) {\n\t\titems.push(formatValue(array[i], seenValues));\n\t}\n\tif (remaining === 1) {\n\t\titems.push('... 1 more item');\n\t} else if (remaining > 1) {\n\t\titems.push(`... ${remaining} more items`);\n\t}\n\treturn `[${items.join(', ')}]`;\n}\n\nfunction getObjectTag(object: object): string {\n\tconst tag = Object.prototype.toString\n\t\t.call(object)\n\t\t.replace(/^\\[object /, '')\n\t\t.replace(/]$/, '');\n\tif (tag === 'Object' && typeof object.constructor === 'function') {\n\t\tconst name = object.constructor.name;\n\t\tif (typeof name === 'string' && name !== '') {\n\t\t\treturn name;\n\t\t}\n\t}\n\treturn tag;\n}\n",
12
12
  "/*!\n * Ported from graphql-js 17.0.2 (src/jsutils/suggestionList.ts,\n * didYouMean.ts, formatList.ts, naturalCompare.ts),\n * https://github.com/graphql/graphql-js\n * Copyright (c) GraphQL Contributors\n * @license MIT\n */\n\n// graphql-js's \"Did you mean …?\" (graphql 17's `suggestionList`,\n// `didYouMean`, `orList` and `naturalCompare`, which\n// @graphql-tools/executor copies), ported line for line so the mock\n// suggests what the API suggests, in the same order. graphql 16 words a\n// few messages differently; graphql-yoga 5 on graphql 17 is the reference.\n\nconst MAX_SUGGESTIONS = 5;\n\n/**\n * ` Did you mean \"a\" or \"b\"?`, after `subject` when given (`the enum\n * value`), or `''` without a suggestion.\n */\nexport function didYouMean(\n\tsuggestions: readonly string[],\n\tsubject?: string,\n): string {\n\tif (suggestions.length === 0) return '';\n\tconst listed = orList(\n\t\tsuggestions.slice(0, MAX_SUGGESTIONS).map((item) => `\"${item}\"`),\n\t);\n\treturn ` Did you mean ${subject ? `${subject} ` : ''}${listed}?`;\n}\n\nfunction orList(items: readonly string[]): string {\n\tif (items.length === 1) return items[0] ?? '';\n\tif (items.length === 2) return `${items[0]} or ${items[1]}`;\n\treturn `${items.slice(0, -1).join(', ')}, or ${items.at(-1)}`;\n}\n\n/** The options close enough to `input`, the closest first. */\nexport function suggestionList(\n\tinput: string,\n\toptions: readonly string[],\n): string[] {\n\tconst distances = new Map<string, number>();\n\tconst threshold = Math.floor(input.length * 0.4) + 1;\n\tfor (const option of options) {\n\t\tconst distance = lexicalDistance(input, option, threshold);\n\t\tif (distance !== undefined) distances.set(option, distance);\n\t}\n\treturn [...distances.keys()].sort(\n\t\t(a, b) =>\n\t\t\t(distances.get(a) ?? 0) - (distances.get(b) ?? 0) || naturalCompare(a, b),\n\t);\n}\n\n/**\n * Damerau-Levenshtein on the lower-cased strings, a change of case alone\n * counting as one edit; undefined beyond `threshold`.\n */\nfunction lexicalDistance(\n\tinput: string,\n\toption: string,\n\tthreshold: number,\n): number | undefined {\n\tif (input === option) return 0;\n\tconst lowerInput = input.toLowerCase();\n\tconst lowerOption = option.toLowerCase();\n\tif (lowerInput === lowerOption) return 1;\n\tlet a = codes(lowerOption);\n\tlet b = codes(lowerInput);\n\tif (a.length < b.length) [a, b] = [b, a];\n\tif (a.length - b.length > threshold) return undefined;\n\tconst rows = [0, 1, 2].map(() => new Array<number>(b.length + 1).fill(0));\n\tconst row = (i: number): number[] => rows[i % 3] as number[];\n\tfor (let j = 0; j <= b.length; j++) row(0)[j] = j;\n\tfor (let i = 1; i <= a.length; i++) {\n\t\tconst up = row(i - 1);\n\t\tconst current = row(i);\n\t\tcurrent[0] = i;\n\t\tlet smallest = i;\n\t\tfor (let j = 1; j <= b.length; j++) {\n\t\t\tconst cost = a[i - 1] === b[j - 1] ? 0 : 1;\n\t\t\tlet cell = Math.min(\n\t\t\t\t(up[j] ?? 0) + 1,\n\t\t\t\t(current[j - 1] ?? 0) + 1,\n\t\t\t\t(up[j - 1] ?? 0) + cost,\n\t\t\t);\n\t\t\tif (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1])\n\t\t\t\tcell = Math.min(cell, (row(i - 2)[j - 2] ?? 0) + 1);\n\t\t\tif (cell < smallest) smallest = cell;\n\t\t\tcurrent[j] = cell;\n\t\t}\n\t\tif (smallest > threshold) return undefined;\n\t}\n\tconst distance = row(a.length)[b.length] ?? 0;\n\treturn distance <= threshold ? distance : undefined;\n}\n\nfunction codes(text: string): number[] {\n\treturn Array.from({ length: text.length }, (_, i) => text.charCodeAt(i));\n}\n\nconst DIGIT_0 = 48;\nconst DIGIT_9 = 57;\n\nconst isDigit = (code: number): boolean =>\n\t!Number.isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9;\n\n/** graphql-js's order for two suggestions equally close: numbers by value. */\nfunction naturalCompare(aText: string, bText: string): number {\n\tlet a = 0;\n\tlet b = 0;\n\twhile (a < aText.length && b < bText.length) {\n\t\tlet aChar = aText.charCodeAt(a);\n\t\tlet bChar = bText.charCodeAt(b);\n\t\tif (isDigit(aChar) && isDigit(bChar)) {\n\t\t\tlet aNumber = 0;\n\t\t\tdo {\n\t\t\t\t++a;\n\t\t\t\taNumber = aNumber * 10 + aChar - DIGIT_0;\n\t\t\t\taChar = aText.charCodeAt(a);\n\t\t\t} while (isDigit(aChar) && aNumber > 0);\n\t\t\tlet bNumber = 0;\n\t\t\tdo {\n\t\t\t\t++b;\n\t\t\t\tbNumber = bNumber * 10 + bChar - DIGIT_0;\n\t\t\t\tbChar = bText.charCodeAt(b);\n\t\t\t} while (isDigit(bChar) && bNumber > 0);\n\t\t\tif (aNumber !== bNumber) return aNumber < bNumber ? -1 : 1;\n\t\t} else {\n\t\t\tif (aChar !== bChar) return aChar < bChar ? -1 : 1;\n\t\t\t++a;\n\t\t\t++b;\n\t\t}\n\t}\n\treturn aText.length - bText.length;\n}\n",
13
- "/*!\n * Messages ported from graphql-js 17.0.2 (src/type/scalars.ts,\n * src/type/definition.ts), https://github.com/graphql/graphql-js\n * Copyright (c) GraphQL Contributors\n * and from @graphql-tools/executor 2.0.3 (execution/validateInputValue,\n * execution/values), https://github.com/ardatan/graphql-tools\n * Copyright (c) 2020 The Guild, Inc.\n * @license MIT\n */\n\n// How graphql 17 words a value it refuses, as graphql-yoga 5 with\n// @graphql-tools/executor 2 answers it: the leaf scalars' and enums' own\n// messages, printed with graphql's `inspect`, and the input object's and\n// the variable's prefix, which the executor words and prints with\n// `cross-inspect`.\nimport type { z } from 'zod';\nimport { crossInspect } from './cross-inspect';\nimport { inspect } from './inspect';\nimport { didYouMean, suggestionList } from './suggestions';\n\nconst INT_MAX = 2_147_483_647;\nconst INT_MIN = -2_147_483_648;\n\n/** Why a built-in scalar refuses `value`, or undefined when it takes it. */\nexport function builtinRefusal(\n\tname: string,\n\tvalue: unknown,\n): string | undefined {\n\tconst found = inspect(value);\n\tswitch (name) {\n\t\tcase 'String':\n\t\t\treturn typeof value === 'string'\n\t\t\t\t? undefined\n\t\t\t\t: `String cannot represent a non string value: ${found}`;\n\t\tcase 'Boolean':\n\t\t\treturn typeof value === 'boolean'\n\t\t\t\t? undefined\n\t\t\t\t: `Boolean cannot represent a non boolean value: ${found}`;\n\t\tcase 'Float':\n\t\t\treturn typeof value === 'number' && Number.isFinite(value)\n\t\t\t\t? undefined\n\t\t\t\t: `Float cannot represent non numeric value: ${found}`;\n\t\tcase 'ID':\n\t\t\treturn typeof value === 'string' || Number.isInteger(value)\n\t\t\t\t? undefined\n\t\t\t\t: `ID cannot represent value: ${found}`;\n\t\tcase 'Int':\n\t\t\treturn intRefusal(value);\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\n/** Int's bound is decided from the declared type, never from a Zod issue. */\nfunction intRefusal(value: unknown): string | undefined {\n\tif (typeof value !== 'number' || !Number.isInteger(value))\n\t\treturn `Int cannot represent non-integer value: ${inspect(value)}`;\n\tif (value > INT_MAX || value < INT_MIN)\n\t\treturn `Int cannot represent non 32-bit signed integer value: ${inspect(value)}`;\n\treturn undefined;\n}\n\n/** Why the enum `name` refuses `value`, with graphql's suggestions. */\nexport function enumRefusal(\n\tname: string,\n\tvalues: readonly string[],\n\tvalue: unknown,\n): string | undefined {\n\tif (typeof value !== 'string') {\n\t\tconst found = inspect(value);\n\t\treturn `Enum \"${name}\" cannot represent non-string value: ${found}.${suggest(found, values)}`;\n\t}\n\tif (values.includes(value)) return undefined;\n\treturn `Value \"${value}\" does not exist in \"${name}\" enum.${suggest(value, values)}`;\n}\n\nfunction suggest(value: string, values: readonly string[]): string {\n\treturn didYouMean(suggestionList(value, values), 'the enum value');\n}\n\n/**\n * Why a custom scalar refuses the value, as a scalar built with\n * `zodScalar` (`@nxgt/graphql-scalars`) words it: its schema's first issue,\n * which the client's schema, the same one, reports too.\n */\nexport function scalarRefusal(\n\tname: string,\n\tissue: z.core.$ZodIssue | undefined,\n): string | undefined {\n\treturn issue && `${name} cannot represent this input: ${issue.message}`;\n}\n\n/** The input object messages, by what is wrong with the object. */\nexport const objectRefusal = {\n\tnotAnObject: (type: string, value: unknown) =>\n\t\t`Expected value of type \"${type}\" to be an object, found: ${crossInspect(value)}.`,\n\tmissingField: (type: string, field: string, object: unknown) =>\n\t\t`Expected value of type \"${type}\" to include required field \"${field}\", found: ${crossInspect(object)}.`,\n\tunknownField: (\n\t\ttype: string,\n\t\tfield: string,\n\t\tknown: readonly string[],\n\t\tobject: unknown,\n\t) => {\n\t\tconst suggestion = didYouMean(suggestionList(field, known));\n\t\treturn `Expected value of type \"${type}\" not to include unknown field \"${field}\"${suggestion ? `.${suggestion} Found` : ', found'}: ${crossInspect(object)}.`;\n\t},\n\toneOf: (type: string) =>\n\t\t`Within OneOf Input Object type \"${type}\", exactly one field must be specified, and the value for that field must be non-null.`,\n\tnotProvided: (type: string) =>\n\t\t`Expected a value of non-null type \"${type}\" to be provided.`,\n\tisNull: (type: string) =>\n\t\t`Expected value of non-null type \"${type}\" not to be null.`,\n};\n\n/** The messages about a variable itself, before its value is walked. */\nexport const variableRefusal = {\n\tnotProvided: (name: string, type: string) =>\n\t\t`Variable \"$${name}\" of required type \"${type}\" was not provided.`,\n\tisNull: (name: string, type: string) =>\n\t\t`Variable \"$${name}\" of non-null type \"${type}\" must not be null.`,\n\t/** `Variable \"$input\" got invalid value 1 at \"input.tags[0]\"; <reason>` */\n\tinvalidValue: (\n\t\tname: string,\n\t\tvalue: unknown,\n\t\tpath: readonly (string | number)[],\n\t\treason: string,\n\t) => {\n\t\tconst at =\n\t\t\tpath.length > 0\n\t\t\t\t? ` at \"${name}${path.map((key) => (typeof key === 'number' ? `[${key}]` : `.${key}`)).join('')}\"`\n\t\t\t\t: '';\n\t\treturn `Variable \"$${name}\" got invalid value ${crossInspect(value)}${at}; ${reason}`;\n\t},\n};\n",
14
- "/*!\n * Ported from @graphql-tools/executor 2.0.3 (execution/validateInputValue),\n * https://github.com/ardatan/graphql-tools\n * Copyright (c) 2020 The Guild, Inc.\n * itself a copy of graphql-js 17's validateInputValue,\n * https://github.com/graphql/graphql-js\n * Copyright (c) GraphQL Contributors\n * @license MIT\n */\n\n// @graphql-tools/executor 2.0.3's copy of graphql 17's `validateInputValue`,\n// the one it runs on each variable, walked over the generated input types:\n// the same problems, at the same paths, in the same order.\nimport {\n\tdeclared,\n\ttype InputType,\n\ttype InputTypes,\n\tprintType,\n\ttype TypeRef,\n} from './document';\nimport { issueAt, type PlacedIssue } from './issues';\nimport {\n\tbuiltinRefusal,\n\tenumRefusal,\n\tobjectRefusal,\n\tscalarRefusal,\n} from './messages';\n\ntype Path = readonly (string | number)[];\ntype InputObject = Extract<InputType, { kind: 'input' }>;\n\n/** One value graphql refuses: where, the value there, and why. */\nexport interface Problem {\n\treadonly path: Path;\n\treadonly value: unknown;\n\treadonly reason: string;\n}\n\n/** What a walk reads, and the problems it found so far. */\nexport interface Walk {\n\treadonly types: InputTypes;\n\treadonly issues: readonly PlacedIssue[];\n\treadonly problems: Problem[];\n}\n\n/** Where a walk stands: graphql's path below the variable, and the Zod schema's. */\ninterface At {\n\treadonly path: Path;\n\t/**\n\t * From the variable's name. It differs from graphql's where a single\n\t * value stands for a list: the schema wraps it (`[0]`), graphql does not.\n\t */\n\treadonly zodPath: Path;\n}\n\n/** Walks `value` at `type`, recording each problem in `walk.problems`. */\nexport function validateValue(\n\twalk: Walk,\n\tvalue: unknown,\n\ttype: TypeRef,\n\tat: At,\n): void {\n\tif (type.kind === 'non-null') {\n\t\tif (value === undefined)\n\t\t\treport(walk, at, value, objectRefusal.notProvided(printType(type)));\n\t\telse if (value === null)\n\t\t\treport(walk, at, value, objectRefusal.isNull(printType(type)));\n\t\telse validateValue(walk, value, type.of, at);\n\t} else if (value === null || value === undefined) {\n\t\t// A nullable type takes null, and an absent field is the object's.\n\t} else if (type.kind === 'list') {\n\t\tvalidateList(walk, value, type.of, at);\n\t} else {\n\t\tvalidateNamed(walk, value, type.name, at);\n\t}\n}\n\nfunction validateList(walk: Walk, value: unknown, item: TypeRef, at: At): void {\n\tif (!Array.isArray(value)) {\n\t\tvalidateValue(walk, value, item, { ...at, zodPath: [...at.zodPath, 0] });\n\t\treturn;\n\t}\n\tvalue.forEach((element, index) => {\n\t\tvalidateValue(walk, element, item, {\n\t\t\tpath: [...at.path, index],\n\t\t\tzodPath: [...at.zodPath, index],\n\t\t});\n\t});\n}\n\n/** The spec scalars, judged as built-ins even when the file omits them. */\nconst BUILT_INS: ReadonlySet<string> = new Set([\n\t'String',\n\t'Int',\n\t'Float',\n\t'Boolean',\n\t'ID',\n]);\n\nfunction validateNamed(walk: Walk, value: unknown, name: string, at: At): void {\n\t// A name the generated file does not describe is judged as a custom\n\t// scalar is: refused only where the Zod schema refused it.\n\tconst named: InputType =\n\t\twalk.types[name] ??\n\t\t(BUILT_INS.has(name) ? { kind: 'builtin' } : { kind: 'scalar' });\n\tif (named.kind === 'input') {\n\t\tvalidateObject(walk, value, name, named, at);\n\t\treturn;\n\t}\n\tconst reason = leafRefusal(walk, value, name, named, at);\n\tif (reason !== undefined) report(walk, at, value, reason);\n}\n\nfunction leafRefusal(\n\twalk: Walk,\n\tvalue: unknown,\n\tname: string,\n\tnamed: Exclude<InputType, InputObject>,\n\tat: At,\n): string | undefined {\n\tswitch (named.kind) {\n\t\tcase 'builtin':\n\t\t\treturn builtinRefusal(name, value);\n\t\tcase 'enum':\n\t\t\treturn enumRefusal(name, named.values, value);\n\t\tcase 'scalar':\n\t\t\treturn scalarRefusal(name, issueAt(walk.issues, at.zodPath));\n\t\tdefault:\n\t\t\t// A kind this runtime does not know: the file was written by\n\t\t\t// another version of the plugin.\n\t\t\tthrow new Error(STALE_FILE);\n\t}\n}\n\n/** Thrown on an input type whose `kind` this runtime does not know. */\nexport const STALE_FILE =\n\t'@nxgt/graphql-codegen-msw: the generated file was written by another version than the runtime; regenerate it';\n\nfunction validateObject(\n\twalk: Walk,\n\tvalue: unknown,\n\tname: string,\n\ttype: InputObject,\n\tat: At,\n): void {\n\tif (typeof value !== 'object' || value === null || Array.isArray(value)) {\n\t\treport(walk, at, value, objectRefusal.notAnObject(name, value));\n\t\treturn;\n\t}\n\tconst object = value as Record<string, unknown>;\n\tfor (const [field, source] of Object.entries(type.fields)) {\n\t\tconst { type: fieldType, hasDefault } = declared(source);\n\t\tconst fieldValue = Object.hasOwn(object, field) ? object[field] : undefined;\n\t\tif (fieldValue !== undefined)\n\t\t\tvalidateValue(walk, fieldValue, fieldType, {\n\t\t\t\tpath: [...at.path, field],\n\t\t\t\tzodPath: [...at.zodPath, field],\n\t\t\t});\n\t\telse if (fieldType.kind === 'non-null' && !hasDefault)\n\t\t\treport(walk, at, object, objectRefusal.missingField(name, field, object));\n\t}\n\tconst names = Object.keys(type.fields);\n\tconst known: string[] = [];\n\tfor (const key of Object.keys(object)) {\n\t\tif (object[key] === undefined) continue;\n\t\tif (Object.hasOwn(type.fields, key)) known.push(key);\n\t\telse\n\t\t\treport(\n\t\t\t\twalk,\n\t\t\t\tat,\n\t\t\t\tobject,\n\t\t\t\tobjectRefusal.unknownField(name, key, names, object),\n\t\t\t);\n\t}\n\tif (type.oneOf) validateOneOf(walk, object, name, known, at);\n}\n\n/** A `@oneOf` input object: exactly one field, and not null. */\nfunction validateOneOf(\n\twalk: Walk,\n\tobject: Record<string, unknown>,\n\tname: string,\n\tknown: readonly string[],\n\tat: At,\n): void {\n\tconst [only] = known;\n\tif (known.length !== 1 || only === undefined)\n\t\treport(walk, at, object, objectRefusal.oneOf(name));\n\telse if (object[only] === null)\n\t\treport(\n\t\t\twalk,\n\t\t\t{ ...at, path: [...at.path, only] },\n\t\t\tobject,\n\t\t\tobjectRefusal.oneOf(name),\n\t\t);\n}\n\nfunction report(walk: Walk, at: At, value: unknown, reason: string): void {\n\twalk.problems.push({ path: at.path, value, reason });\n}\n",
13
+ "/*!\n * Messages ported from graphql-js 17.0.2 (src/type/scalars.ts,\n * src/type/definition.ts), https://github.com/graphql/graphql-js\n * Copyright (c) GraphQL Contributors\n * and from @graphql-tools/executor 2.0.3 (execution/validateInputValue,\n * execution/values), https://github.com/ardatan/graphql-tools\n * Copyright (c) 2020 The Guild, Inc.\n * @license MIT\n */\n\n// How graphql 17 words a value it refuses, as graphql-yoga 5 with\n// @graphql-tools/executor 2 answers it: the leaf scalars' and enums' own\n// messages, printed with graphql's `inspect`, and the input object's and\n// the variable's prefix, which the executor words and prints with\n// `cross-inspect`.\nimport type { z } from 'zod';\nimport { crossInspect } from './cross-inspect';\nimport { inspect } from './inspect';\nimport { didYouMean, suggestionList } from './suggestions';\n\nconst INT_MAX = 2_147_483_647;\nconst INT_MIN = -2_147_483_648;\n\n/** Why a built-in scalar refuses `value`, or undefined when it takes it. */\nexport function builtinRefusal(\n\tname: string,\n\tvalue: unknown,\n): string | undefined {\n\tconst found = inspect(value);\n\tswitch (name) {\n\t\tcase 'String':\n\t\t\treturn typeof value === 'string'\n\t\t\t\t? undefined\n\t\t\t\t: `String cannot represent a non string value: ${found}`;\n\t\tcase 'Boolean':\n\t\t\treturn typeof value === 'boolean'\n\t\t\t\t? undefined\n\t\t\t\t: `Boolean cannot represent a non boolean value: ${found}`;\n\t\tcase 'Float':\n\t\t\treturn typeof value === 'number' && Number.isFinite(value)\n\t\t\t\t? undefined\n\t\t\t\t: `Float cannot represent non numeric value: ${found}`;\n\t\tcase 'ID':\n\t\t\treturn typeof value === 'string' || Number.isInteger(value)\n\t\t\t\t? undefined\n\t\t\t\t: `ID cannot represent value: ${found}`;\n\t\tcase 'Int':\n\t\t\treturn intRefusal(value);\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\n/** Int's bound is decided from the declared type, never from a Zod issue. */\nfunction intRefusal(value: unknown): string | undefined {\n\tif (typeof value !== 'number' || !Number.isInteger(value))\n\t\treturn `Int cannot represent non-integer value: ${inspect(value)}`;\n\tif (value > INT_MAX || value < INT_MIN)\n\t\treturn `Int cannot represent non 32-bit signed integer value: ${inspect(value)}`;\n\treturn undefined;\n}\n\n/** Why the enum `name` refuses `value`, with graphql's suggestions. */\nexport function enumRefusal(\n\tname: string,\n\tvalues: readonly string[],\n\tvalue: unknown,\n): string | undefined {\n\tif (typeof value !== 'string') {\n\t\tconst found = inspect(value);\n\t\treturn `Enum \"${name}\" cannot represent non-string value: ${found}.${suggest(found, values)}`;\n\t}\n\tif (values.includes(value)) return undefined;\n\treturn `Value \"${value}\" does not exist in \"${name}\" enum.${suggest(value, values)}`;\n}\n\nfunction suggest(value: string, values: readonly string[]): string {\n\treturn didYouMean(suggestionList(value, values), 'the enum value');\n}\n\n/**\n * Why a custom scalar refuses the value, and the `extensions` it carries, as\n * a scalar built with `zodScalar` (`@nxgt/graphql-scalars`) words it: its\n * schema's first issue, which the client's schema, the same one, reports too.\n */\nexport function scalarRefusal(\n\tname: string,\n\tissue: z.core.$ZodIssue | undefined,\n): { reason: string; extensions: Record<string, unknown> } | undefined {\n\treturn (\n\t\tissue && {\n\t\t\treason: `${name} cannot represent this input: ${issue.message}`,\n\t\t\t// What `zodScalar` puts in its error, which graphql keeps on the\n\t\t\t// variable's.\n\t\t\textensions: { code: 'INVALID_SCALAR', scalar: name, reason: issue.code },\n\t\t}\n\t);\n}\n\n/** The input object messages, by what is wrong with the object. */\nexport const objectRefusal = {\n\tnotAnObject: (type: string, value: unknown) =>\n\t\t`Expected value of type \"${type}\" to be an object, found: ${crossInspect(value)}.`,\n\tmissingField: (type: string, field: string, object: unknown) =>\n\t\t`Expected value of type \"${type}\" to include required field \"${field}\", found: ${crossInspect(object)}.`,\n\tunknownField: (\n\t\ttype: string,\n\t\tfield: string,\n\t\tknown: readonly string[],\n\t\tobject: unknown,\n\t) => {\n\t\tconst suggestion = didYouMean(suggestionList(field, known));\n\t\treturn `Expected value of type \"${type}\" not to include unknown field \"${field}\"${suggestion ? `.${suggestion} Found` : ', found'}: ${crossInspect(object)}.`;\n\t},\n\toneOf: (type: string) =>\n\t\t`Within OneOf Input Object type \"${type}\", exactly one field must be specified, and the value for that field must be non-null.`,\n\tnotProvided: (type: string) =>\n\t\t`Expected a value of non-null type \"${type}\" to be provided.`,\n\tisNull: (type: string) =>\n\t\t`Expected value of non-null type \"${type}\" not to be null.`,\n};\n\n/** The messages about a variable itself, before its value is walked. */\nexport const variableRefusal = {\n\tnotProvided: (name: string, type: string) =>\n\t\t`Variable \"$${name}\" of required type \"${type}\" was not provided.`,\n\tisNull: (name: string, type: string) =>\n\t\t`Variable \"$${name}\" of non-null type \"${type}\" must not be null.`,\n\t/** `Variable \"$input\" got invalid value 1 at \"input.tags[0]\"; <reason>` */\n\tinvalidValue: (\n\t\tname: string,\n\t\tvalue: unknown,\n\t\tpath: readonly (string | number)[],\n\t\treason: string,\n\t) => {\n\t\tconst at =\n\t\t\tpath.length > 0\n\t\t\t\t? ` at \"${name}${path.map((key) => (typeof key === 'number' ? `[${key}]` : `.${key}`)).join('')}\"`\n\t\t\t\t: '';\n\t\treturn `Variable \"$${name}\" got invalid value ${crossInspect(value)}${at}; ${reason}`;\n\t},\n};\n",
14
+ "/*!\n * Ported from @graphql-tools/executor 2.0.3 (execution/validateInputValue),\n * https://github.com/ardatan/graphql-tools\n * Copyright (c) 2020 The Guild, Inc.\n * itself a copy of graphql-js 17's validateInputValue,\n * https://github.com/graphql/graphql-js\n * Copyright (c) GraphQL Contributors\n * @license MIT\n */\n\n// @graphql-tools/executor 2.0.3's copy of graphql 17's `validateInputValue`,\n// the one it runs on each variable, walked over the generated input types:\n// the same problems, at the same paths, in the same order.\nimport {\n\tdeclared,\n\ttype InputType,\n\ttype InputTypes,\n\tprintType,\n\ttype TypeRef,\n} from './document';\nimport { issueAt, type PlacedIssue } from './issues';\nimport {\n\tbuiltinRefusal,\n\tenumRefusal,\n\tobjectRefusal,\n\tscalarRefusal,\n} from './messages';\n\ntype Path = readonly (string | number)[];\ntype InputObject = Extract<InputType, { kind: 'input' }>;\n\n/** One value graphql refuses: where, the value there, and why. */\nexport interface Problem {\n\treadonly path: Path;\n\treadonly value: unknown;\n\treadonly reason: string;\n\t/** What the refusing scalar puts in its error's `extensions`. */\n\treadonly extensions?: Record<string, unknown>;\n}\n\n/** What a walk reads, and the problems it found so far. */\nexport interface Walk {\n\treadonly types: InputTypes;\n\treadonly issues: readonly PlacedIssue[];\n\treadonly problems: Problem[];\n}\n\n/** Where a walk stands: graphql's path below the variable, and the Zod schema's. */\ninterface At {\n\treadonly path: Path;\n\t/**\n\t * From the variable's name. It differs from graphql's where a single\n\t * value stands for a list: the schema wraps it (`[0]`), graphql does not.\n\t */\n\treadonly zodPath: Path;\n}\n\n/** Walks `value` at `type`, recording each problem in `walk.problems`. */\nexport function validateValue(\n\twalk: Walk,\n\tvalue: unknown,\n\ttype: TypeRef,\n\tat: At,\n): void {\n\tif (type.kind === 'non-null') {\n\t\tif (value === undefined)\n\t\t\treport(walk, at, value, objectRefusal.notProvided(printType(type)));\n\t\telse if (value === null)\n\t\t\treport(walk, at, value, objectRefusal.isNull(printType(type)));\n\t\telse validateValue(walk, value, type.of, at);\n\t} else if (value === null || value === undefined) {\n\t\t// A nullable type takes null, and an absent field is the object's.\n\t} else if (type.kind === 'list') {\n\t\tvalidateList(walk, value, type.of, at);\n\t} else {\n\t\tvalidateNamed(walk, value, type.name, at);\n\t}\n}\n\nfunction validateList(walk: Walk, value: unknown, item: TypeRef, at: At): void {\n\tif (!Array.isArray(value)) {\n\t\tvalidateValue(walk, value, item, { ...at, zodPath: [...at.zodPath, 0] });\n\t\treturn;\n\t}\n\tvalue.forEach((element, index) => {\n\t\tvalidateValue(walk, element, item, {\n\t\t\tpath: [...at.path, index],\n\t\t\tzodPath: [...at.zodPath, index],\n\t\t});\n\t});\n}\n\n/** The spec scalars, judged as built-ins even when the file omits them. */\nconst BUILT_INS: ReadonlySet<string> = new Set([\n\t'String',\n\t'Int',\n\t'Float',\n\t'Boolean',\n\t'ID',\n]);\n\nfunction validateNamed(walk: Walk, value: unknown, name: string, at: At): void {\n\t// A name the generated file does not describe is judged as a custom\n\t// scalar is: refused only where the Zod schema refused it.\n\tconst named: InputType =\n\t\twalk.types[name] ??\n\t\t(BUILT_INS.has(name) ? { kind: 'builtin' } : { kind: 'scalar' });\n\tif (named.kind === 'input') {\n\t\tvalidateObject(walk, value, name, named, at);\n\t\treturn;\n\t}\n\tconst refusal = leafRefusal(walk, value, name, named, at);\n\tif (refusal !== undefined)\n\t\treport(walk, at, value, refusal.reason, refusal.extensions);\n}\n\nfunction leafRefusal(\n\twalk: Walk,\n\tvalue: unknown,\n\tname: string,\n\tnamed: Exclude<InputType, InputObject>,\n\tat: At,\n): { reason: string; extensions?: Record<string, unknown> } | undefined {\n\tswitch (named.kind) {\n\t\tcase 'builtin':\n\t\t\treturn plain(builtinRefusal(name, value));\n\t\tcase 'enum':\n\t\t\treturn plain(enumRefusal(name, named.values, value));\n\t\tcase 'scalar':\n\t\t\treturn scalarRefusal(name, issueAt(walk.issues, at.zodPath));\n\t\tdefault:\n\t\t\t// A kind this runtime does not know: the file was written by\n\t\t\t// another version of the plugin.\n\t\t\tthrow new Error(STALE_FILE);\n\t}\n}\n\nfunction plain(reason: string | undefined): { reason: string } | undefined {\n\treturn reason === undefined ? undefined : { reason };\n}\n\n/** Thrown on an input type whose `kind` this runtime does not know. */\nexport const STALE_FILE =\n\t'@nxgt/graphql-codegen-msw: the generated file was written by another version than the runtime; regenerate it';\n\nfunction validateObject(\n\twalk: Walk,\n\tvalue: unknown,\n\tname: string,\n\ttype: InputObject,\n\tat: At,\n): void {\n\tif (typeof value !== 'object' || value === null || Array.isArray(value)) {\n\t\treport(walk, at, value, objectRefusal.notAnObject(name, value));\n\t\treturn;\n\t}\n\tconst object = value as Record<string, unknown>;\n\tfor (const [field, source] of Object.entries(type.fields)) {\n\t\tconst { type: fieldType, hasDefault } = declared(source);\n\t\tconst fieldValue = Object.hasOwn(object, field) ? object[field] : undefined;\n\t\tif (fieldValue !== undefined)\n\t\t\tvalidateValue(walk, fieldValue, fieldType, {\n\t\t\t\tpath: [...at.path, field],\n\t\t\t\tzodPath: [...at.zodPath, field],\n\t\t\t});\n\t\telse if (fieldType.kind === 'non-null' && !hasDefault)\n\t\t\treport(walk, at, object, objectRefusal.missingField(name, field, object));\n\t}\n\tconst names = Object.keys(type.fields);\n\tconst known: string[] = [];\n\tfor (const key of Object.keys(object)) {\n\t\tif (object[key] === undefined) continue;\n\t\tif (Object.hasOwn(type.fields, key)) known.push(key);\n\t\telse\n\t\t\treport(\n\t\t\t\twalk,\n\t\t\t\tat,\n\t\t\t\tobject,\n\t\t\t\tobjectRefusal.unknownField(name, key, names, object),\n\t\t\t);\n\t}\n\tif (type.oneOf) validateOneOf(walk, object, name, known, at);\n}\n\n/** A `@oneOf` input object: exactly one field, and not null. */\nfunction validateOneOf(\n\twalk: Walk,\n\tobject: Record<string, unknown>,\n\tname: string,\n\tknown: readonly string[],\n\tat: At,\n): void {\n\tconst [only] = known;\n\tif (known.length !== 1 || only === undefined)\n\t\treport(walk, at, object, objectRefusal.oneOf(name));\n\telse if (object[only] === null)\n\t\treport(\n\t\t\twalk,\n\t\t\t{ ...at, path: [...at.path, only] },\n\t\t\tobject,\n\t\t\tobjectRefusal.oneOf(name),\n\t\t);\n}\n\nfunction report(\n\twalk: Walk,\n\tat: At,\n\tvalue: unknown,\n\treason: string,\n\textensions?: Record<string, unknown>,\n): void {\n\twalk.problems.push({\n\t\tpath: at.path,\n\t\tvalue,\n\t\treason,\n\t\t...(extensions === undefined ? {} : { extensions }),\n\t});\n}\n",
15
15
  "import type { GraphQLError, GraphQLFormattedError } from 'graphql';\nimport { HttpResponse } from 'msw';\n\n/** An error as a resolver throws it, or as it goes on the wire. */\nexport type AnyGraphQLError = GraphQLError | GraphQLFormattedError;\n\n/**\n * Whether `value` is a `GraphQLError`, from any copy of `graphql`: by its\n * name (or its `[object GraphQLError]` tag, which a subclass with its own\n * `name` keeps) and its `toJSON`, never `instanceof`, so an error your\n * application built with its own `graphql` is one too.\n */\nexport function isGraphQLError(value: unknown): value is GraphQLError {\n\treturn (\n\t\tvalue instanceof Error &&\n\t\t(value.name === 'GraphQLError' ||\n\t\t\tObject.prototype.toString.call(value) === '[object GraphQLError]') &&\n\t\ttypeof (value as { toJSON?: unknown }).toJSON === 'function'\n\t);\n}\n\n/**\n * `error` as the response carries it: a `GraphQLError`'s `toJSON()`, or\n * itself, without `extensions.http` and `extensions.unexpected`, which\n * graphql-yoga keeps for itself and never sends (an `extensions` left empty\n * goes too).\n */\nexport function formatted(error: AnyGraphQLError): GraphQLFormattedError {\n\tconst json = isGraphQLError(error) ? error.toJSON() : error;\n\tconst { extensions, ...rest } = json;\n\tif (extensions === undefined) return json;\n\tconst { http: _http, unexpected: _unexpected, ...kept } = extensions;\n\treturn Object.keys(kept).length > 0 ? { ...rest, extensions: kept } : rest;\n}\n\n/**\n * `status` when a response can carry it: an integer from 200 to 599 other\n * than 204, 205 and 304, which have no body.\n */\nfunction validStatus(status: unknown): number | undefined {\n\treturn typeof status === 'number' &&\n\t\tNumber.isInteger(status) &&\n\t\tstatus >= 200 &&\n\t\tstatus <= 599 &&\n\t\tstatus !== 204 &&\n\t\tstatus !== 205 &&\n\t\tstatus !== 304\n\t\t? status\n\t\t: undefined;\n}\n\n/** `extensions.http.status`, when it is a status a response can carry. */\nexport function statusOf(error: AnyGraphQLError): number | undefined {\n\tconst http = (error.extensions as { http?: { status?: unknown } } | undefined)\n\t\t?.http;\n\treturn validStatus(http?.status);\n}\n\n/**\n * A GraphQL response holding `errors` only, as graphql-yoga answers one:\n * `{ errors }`, each error without its `extensions.http` (see `formatted`),\n * at `status` when a response can carry it, else the highest\n * `extensions.http.status` among the errors, else 200. What a resolver\n * returns to refuse, as your server would:\n * `return errorResponse(fieldsError('conflict', fields, { status: 409 }))`.\n */\nexport function errorResponse(\n\terror: AnyGraphQLError | readonly AnyGraphQLError[],\n\tinit: { readonly status?: number } = {},\n): HttpResponse<{ errors: GraphQLFormattedError[] }> {\n\tconst errors = (Array.isArray(error) ? error : [error]) as AnyGraphQLError[];\n\tconst statuses = errors\n\t\t.map(statusOf)\n\t\t.filter((status) => status !== undefined);\n\tconst status =\n\t\tvalidStatus(init.status) ??\n\t\t(statuses.length > 0 ? Math.max(...statuses) : 200);\n\treturn HttpResponse.json({ errors: errors.map(formatted) }, { status });\n}\n",
16
16
  "import {\n\tbadUserInput,\n\tfieldIssueOf,\n\tinvalidInputError,\n\ttype Translate,\n} from '@nxgt/graphql-validation';\nimport { z } from 'zod';\nimport type { AnyGraphQLError } from './response';\n\n/** The operation whose variables were refused. */\nexport interface RefusedOperation {\n\treadonly type: 'query' | 'mutation';\n\t/** The operation's name in the document: `SignUp`. */\n\treadonly name: string;\n}\n\n/** What an invalid input is answered with: the one error, and the HTTP status. */\nexport interface InvalidInputAnswer {\n\treadonly error: AnyGraphQLError;\n\treadonly status: number;\n}\n\n/**\n * Answers an invalid input: the issues of the variables' Zod schema (each\n * `path` starting with the variable's name) and the operation, to the error\n * and status the handler responds with. The resolver is not called.\n */\nexport type InvalidInput = (\n\tissues: readonly z.core.$ZodIssue[],\n\toperation: RefusedOperation,\n) => InvalidInputAnswer | Promise<InvalidInputAnswer>;\n\n/**\n * The default answer: `invalidInputError`'s one 400 error, its `fields` the\n * issues in order through `fieldIssueOf` (`@nxgt/graphql-validation`'s),\n * each message `translate(code)`, or the code without a translator.\n */\nexport function invalidInputRefusal(\n\toptions: { readonly translate?: Translate } = {},\n): InvalidInput {\n\tconst { translate } = options;\n\treturn (issues) => ({\n\t\terror: invalidInputError(\n\t\t\tissues.map(fieldIssueOf),\n\t\t\ttranslate ? { translate } : {},\n\t\t),\n\t\tstatus: 400,\n\t});\n}\n\n/**\n * The answer `withValidation` gives: one `BAD_USER_INPUT` error,\n * `Invalid arguments for <operation>. <path>: <first message>`, its\n * `extensions.issues` each with its path inside the variables; status 200,\n * as a GraphQL server answers a resolver's error.\n */\nexport const badUserInputRefusal: InvalidInput = (issues, operation) => ({\n\terror: badUserInput(operation.name, new z.ZodError([...issues])),\n\tstatus: 200,\n});\n"
17
17
  ],
18
- "mappings": ";AAEA;AAAA,kBAGC;AAAA;AAAA;AAAA,uBAGA;AAAA;;;ACFD;AAAA;AAAA;;;ACWA;;;ACjBA;AAAA;AAAA;AAAA;AA0CO,SAAS,QAAQ,CAAC,QAA0B;AAAA,EAClD,MAAM,KAAK,OAAO,QAAQ,KAAK;AAAA,EAC/B,MAAM,UAAU,OAAO,KAAK,SAAS,OAAO,MAAM,GAAG,EAAE;AAAA,EACvD,OAAO,EAAE,MAAM,QAAQ,QAAQ,KAAK,CAAC,GAAG,YAAY,OAAO,GAAG;AAAA;AAG/D,SAAS,OAAO,CAAC,SAA0B;AAAA,EAC1C,IAAI,QAAQ,SAAS,GAAG;AAAA,IACvB,OAAO,EAAE,MAAM,YAAY,IAAI,QAAQ,QAAQ,MAAM,GAAG,EAAE,CAAC,EAAE;AAAA,EAC9D,IAAI,QAAQ,WAAW,GAAG,KAAK,QAAQ,SAAS,GAAG;AAAA,IAClD,OAAO,EAAE,MAAM,QAAQ,IAAI,QAAQ,QAAQ,MAAM,GAAG,EAAE,CAAC,EAAE;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AgB,CAAC;AAAA,MAG1D,QAAQ,OAAO,WAAW,MAAM,UAAU,aAAa,QAAQ,KAAK;AAAA,MACpE,OAAO,cAAc,OAAO,EAAE,OAAO,CAAC;AAAA,IACvC;AAAA,IACA,IAAI;AAAA,MACH,MAAM,SAAS,MAAM,SAAS,IAAkC;AAAA,MAChE,kBAAkB,QAAQ,UAAU,IAAI;AAAA,MACxC,OAAO;AAAA,MACN,OAAO,OAAO;AAAA,MACf,IAAI,eAAe,KAAK;AAAA,QAAG,OAAO,cAAc,KAAK;AAAA,MACrD,MAAM;AAAA;AAAA,KAGR,cACD;AAAA;AAQD,SAAS,iBAAiB,CAAC,QAAiB,MAAoB;AAAA,EAC/D,IACC,OAAO,WAAW,YAClB,WAAW,QACX,EAAE,kBAAkB,aACpB,OAAQ,OAA8B,SAAS,YAC9C;AAAA,IACD,MAAM,IAAI,UACT,8CAA8C,qQAC/C;AAAA,EACD;AAAA;;AU/ID;AAAA;AAAA;AAAA;AAAA;AAMA;AA+BO,SAAS,mBAAmB,CAClC,UAA8C,CAAC,GAChC;AAAA,EACf,QAAQ,cAAc;AAAA,EACtB,OAAO,CAAC,YAAY;AAAA,IACnB,OAAO,kBACN,OAAO,IAAI,YAAY,GACvB,YAAY,EAAE,UAAU,IAAI,CAAC,CAC9B;AAAA,IACA,QAAQ;AAAA,EACT;AAAA;AASM,IAAM,sBAAoC,CAAC,QAAQ,eAAe;AAAA,EACxE,OAAO,aAAa,UAAU,MAAM,IAAI,EAAE,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC;AAAA,EAC/D,QAAQ;AACT;",
19
+ "debugId": "A78B80C245DE4C5F64756E2164756E21",
20
20
  "names": []
21
21
  }
@@ -254,7 +254,10 @@ invalid-input answer never names them. The mock answers them as graphql-yoga
254
254
  - status **400**, under `Accept: application/json` and
255
255
  `application/graphql-response+json` alike;
256
256
  - one plain GraphQL error per problem, `{ message, locations }`, with no
257
- `extensions`: no `code`, no `fields`;
257
+ `extensions`: no `code`, no `fields`. The one exception is a value a
258
+ `zodScalar` refuses: its error carries the scalar's
259
+ `{ code: 'INVALID_SCALAR', scalar, reason }` (the scalar's GraphQL name and
260
+ Zod's issue code), as `@nxgt/graphql-scalars` puts it on the server;
258
261
  - the message in graphql 17's wording, every type named as the schema names
259
262
  it and graphql's "Did you mean …?" included, located at the variable's
260
263
  definition in the query sent;
@@ -436,7 +439,7 @@ starts with the variable's name, where the server's starts with the
436
439
  argument's (the first two are the same when the variable is named after the
437
440
  argument); and the mock answers `{ errors }` alone, with no `data`, and no
438
441
  `path` or `locations` on the error, which the server's execution adds. There
439
- is no `constraint` on an issue, as on a client.
442
+ is no `constraint` nor `value` on an issue, as on a client.
440
443
 
441
444
  ### `'<module>#<export>'`: your own
442
445
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/graphql-codegen-msw",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "A graphql-codegen plugin that writes one typed msw 3 handler per named query and mutation, its variables checked by the Zod schemas of @nxgt/graphql-codegen-zod and an invalid input answered as your API answers it",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -59,14 +59,14 @@
59
59
  ]
60
60
  },
61
61
  "dependencies": {
62
- "@nxgt/graphql-validation": "^0.5.0",
62
+ "@nxgt/graphql-validation": "^0.6.0",
63
63
  "change-case": "^5.4.4"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@graphql-codegen/typescript": "6.1.2",
67
67
  "@graphql-codegen/typescript-operations": "6.1.10",
68
68
  "@mswjs/interceptors": "0.45.7",
69
- "@nxgt/graphql-codegen-zod": "^0.3.3",
69
+ "@nxgt/graphql-codegen-zod": "^0.3.4",
70
70
  "@types/bun": "^1.4.0",
71
71
  "graphql": "16.11.0",
72
72
  "msw": "3.0.3",