Skip to content

Commit

Permalink
fix(database): gRPC schema registration removing schema extensions fr…
Browse files Browse the repository at this point in the history
…om adapter models
  • Loading branch information
kon14 authored and kkopanidis committed Aug 26, 2022
1 parent eb57231 commit fc36e90
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/database/src/adapters/DatabaseAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ export abstract class DatabaseAdapter<T extends Schema> {
}
(schema as _ConduitSchema).collectionName = collectionName;
}
if (schema.name !== '_DeclaredSchema') {
const schemaModel = await this.getSchemaModel('_DeclaredSchema').model.findOne({
name: schema.name,
});
if (schemaModel?.extensions?.length > 0) {
(schema as any).extensions = schemaModel.extensions;
}
}
const createdSchema = this._createSchemaFromAdapter(schema);
if (!this.registeredSchemas.has(schema.name)) {
ConduitGrpcSdk.Metrics?.increment('registered_schemas_total', 1, {
Expand Down

0 comments on commit fc36e90

Please sign in to comment.