@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.js CHANGED
@@ -286,6 +286,14 @@ function buildReverseLookups(ctx) {
286
286
  for (const [typeName, typeReg] of ctx.types) {
287
287
  ctx.schemaToTypeName.set(typeReg.schema, typeName);
288
288
  ctx.astToTypeName.set(typeReg.schema.ast, typeName);
289
+ let ast = typeReg.schema.ast;
290
+ while (ast._tag === "Transformation") {
291
+ ast = ast.to;
292
+ ctx.astToTypeName.set(ast, typeName);
293
+ }
294
+ if (ast._tag === "Declaration" && ast.typeParameters?.[0]) {
295
+ ctx.astToTypeName.set(ast.typeParameters[0], typeName);
296
+ }
289
297
  }
290
298
  }
291
299
  if (!ctx.schemaToInterfaceName) {
@@ -294,6 +302,14 @@ function buildReverseLookups(ctx) {
294
302
  for (const [interfaceName, interfaceReg] of ctx.interfaces) {
295
303
  ctx.schemaToInterfaceName.set(interfaceReg.schema, interfaceName);
296
304
  ctx.astToInterfaceName.set(interfaceReg.schema.ast, interfaceName);
305
+ let ast = interfaceReg.schema.ast;
306
+ while (ast._tag === "Transformation") {
307
+ ast = ast.to;
308
+ ctx.astToInterfaceName.set(ast, interfaceName);
309
+ }
310
+ if (ast._tag === "Declaration" && ast.typeParameters?.[0]) {
311
+ ctx.astToInterfaceName.set(ast.typeParameters[0], interfaceName);
312
+ }
297
313
  }
298
314
  }
299
315
  if (!ctx.schemaToInputName) {
@@ -302,6 +318,14 @@ function buildReverseLookups(ctx) {
302
318
  for (const [inputName, inputReg] of ctx.inputs) {
303
319
  ctx.schemaToInputName.set(inputReg.schema, inputName);
304
320
  ctx.astToInputName.set(inputReg.schema.ast, inputName);
321
+ let ast = inputReg.schema.ast;
322
+ while (ast._tag === "Transformation") {
323
+ ast = ast.to;
324
+ ctx.astToInputName.set(ast, inputName);
325
+ }
326
+ if (ast._tag === "Declaration" && ast.typeParameters?.[0]) {
327
+ ctx.astToInputName.set(ast.typeParameters[0], inputName);
328
+ }
305
329
  }
306
330
  }
307
331
  if (!ctx.enumSortedValues) {
@@ -596,6 +620,14 @@ function buildInputTypeLookupCache(inputs, enums) {
596
620
  for (const [inputName, inputReg] of inputs) {
597
621
  cache.schemaToInputName.set(inputReg.schema, inputName);
598
622
  cache.astToInputName.set(inputReg.schema.ast, inputName);
623
+ let ast = inputReg.schema.ast;
624
+ while (ast._tag === "Transformation") {
625
+ ast = ast.to;
626
+ cache.astToInputName.set(ast, inputName);
627
+ }
628
+ if (ast._tag === "Declaration" && ast.typeParameters?.[0]) {
629
+ cache.astToInputName.set(ast.typeParameters[0], inputName);
630
+ }
599
631
  }
600
632
  for (const [enumName, enumReg] of enums) {
601
633
  cache.enumSortedValues.set(enumName, [...enumReg.values].sort());