@effect-gql/core 1.4.2 → 1.4.3

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/index.cjs CHANGED
@@ -311,6 +311,14 @@ function buildReverseLookups(ctx) {
311
311
  for (const [typeName, typeReg] of ctx.types) {
312
312
  ctx.schemaToTypeName.set(typeReg.schema, typeName);
313
313
  ctx.astToTypeName.set(typeReg.schema.ast, typeName);
314
+ let ast = typeReg.schema.ast;
315
+ while (ast._tag === "Transformation") {
316
+ ast = ast.to;
317
+ ctx.astToTypeName.set(ast, typeName);
318
+ }
319
+ if (ast._tag === "Declaration" && ast.typeParameters?.[0]) {
320
+ ctx.astToTypeName.set(ast.typeParameters[0], typeName);
321
+ }
314
322
  }
315
323
  }
316
324
  if (!ctx.schemaToInterfaceName) {
@@ -319,6 +327,14 @@ function buildReverseLookups(ctx) {
319
327
  for (const [interfaceName, interfaceReg] of ctx.interfaces) {
320
328
  ctx.schemaToInterfaceName.set(interfaceReg.schema, interfaceName);
321
329
  ctx.astToInterfaceName.set(interfaceReg.schema.ast, interfaceName);
330
+ let ast = interfaceReg.schema.ast;
331
+ while (ast._tag === "Transformation") {
332
+ ast = ast.to;
333
+ ctx.astToInterfaceName.set(ast, interfaceName);
334
+ }
335
+ if (ast._tag === "Declaration" && ast.typeParameters?.[0]) {
336
+ ctx.astToInterfaceName.set(ast.typeParameters[0], interfaceName);
337
+ }
322
338
  }
323
339
  }
324
340
  if (!ctx.schemaToInputName) {
@@ -327,6 +343,14 @@ function buildReverseLookups(ctx) {
327
343
  for (const [inputName, inputReg] of ctx.inputs) {
328
344
  ctx.schemaToInputName.set(inputReg.schema, inputName);
329
345
  ctx.astToInputName.set(inputReg.schema.ast, inputName);
346
+ let ast = inputReg.schema.ast;
347
+ while (ast._tag === "Transformation") {
348
+ ast = ast.to;
349
+ ctx.astToInputName.set(ast, inputName);
350
+ }
351
+ if (ast._tag === "Declaration" && ast.typeParameters?.[0]) {
352
+ ctx.astToInputName.set(ast.typeParameters[0], inputName);
353
+ }
330
354
  }
331
355
  }
332
356
  if (!ctx.enumSortedValues) {
@@ -621,6 +645,14 @@ function buildInputTypeLookupCache(inputs, enums) {
621
645
  for (const [inputName, inputReg] of inputs) {
622
646
  cache.schemaToInputName.set(inputReg.schema, inputName);
623
647
  cache.astToInputName.set(inputReg.schema.ast, inputName);
648
+ let ast = inputReg.schema.ast;
649
+ while (ast._tag === "Transformation") {
650
+ ast = ast.to;
651
+ cache.astToInputName.set(ast, inputName);
652
+ }
653
+ if (ast._tag === "Declaration" && ast.typeParameters?.[0]) {
654
+ cache.astToInputName.set(ast.typeParameters[0], inputName);
655
+ }
624
656
  }
625
657
  for (const [enumName, enumReg] of enums) {
626
658
  cache.enumSortedValues.set(enumName, [...enumReg.values].sort());