@conduit-client/generator-ts 3.17.2 → 3.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/v1/index.js CHANGED
@@ -3798,6 +3798,8 @@ class BindingsGenerator {
3798
3798
  const wrapperFilename = "artifacts/bindings.ts";
3799
3799
  const wrapperFile = this.services.file.build(wrapperFilename);
3800
3800
  wrapperFile.template = this.wrapperTemplate;
3801
+ const CUSTOM_TYPE_REGISTRY_PARAM = "customTypeRegistry";
3802
+ const CUSTOM_GRAPHQL_TYPE_REGISTRY_PARAM = "customGraphqlTypeRegistry";
3801
3803
  let typeRegistryRef;
3802
3804
  let graphqlTypeRegistryRef;
3803
3805
  if (this.hasRESTNormalization) {
@@ -3805,11 +3807,11 @@ class BindingsGenerator {
3805
3807
  typeRegistryRef = typeRegistryGenerator.build();
3806
3808
  coreFile.pushTo(
3807
3809
  this.initGeneratedBindingsExtraParamsSymbol,
3808
- code`, typeRegistry?: ${typeRegistryRef}`
3810
+ code`, ${CUSTOM_TYPE_REGISTRY_PARAM}?: ${typeRegistryRef}`
3809
3811
  );
3810
3812
  coreFile.pushTo(
3811
3813
  this.typeRegistryInstantiationSymbol,
3812
- code`typeRegistry ??= new ${typeRegistryRef}(services);`
3814
+ code`const typeRegistry = ${CUSTOM_TYPE_REGISTRY_PARAM} ?? new ${typeRegistryRef}(services);`
3813
3815
  );
3814
3816
  const { declarations, definitions } = this.buildTypeInvalidation(
3815
3817
  typeRegistryGenerator.invalidatableTypes
@@ -3822,7 +3824,7 @@ class BindingsGenerator {
3822
3824
  graphqlTypeRegistryRef = graphqlTypeRegistryGenerator.build();
3823
3825
  coreFile.pushTo(
3824
3826
  this.initGeneratedBindingsExtraParamsSymbol,
3825
- code`, graphqlTypeRegistry?: ${graphqlTypeRegistryRef}`
3827
+ code`, ${CUSTOM_GRAPHQL_TYPE_REGISTRY_PARAM}?: ${graphqlTypeRegistryRef}`
3826
3828
  );
3827
3829
  const firstGraphQLCommand = this.commandModels.find(
3828
3830
  (model) => model.operationType === "graphql"
@@ -3843,7 +3845,7 @@ class BindingsGenerator {
3843
3845
  }) : void 0;
3844
3846
  coreFile.pushTo(
3845
3847
  this.rootTypesInstantiationSymbol,
3846
- code`graphqlTypeRegistry ??= new ${graphqlTypeRegistryRef}(services);
3848
+ code`const graphqlTypeRegistry = ${CUSTOM_GRAPHQL_TYPE_REGISTRY_PARAM} ?? new ${graphqlTypeRegistryRef}(services);
3847
3849
  const ${QUERY_TYPE_VARIABLE_NAME} = graphqlTypeRegistry.${queryType.propertyName};`
3848
3850
  );
3849
3851
  if (mutationType) {