mirror of
https://github.com/vale981/grapher
synced 2025-03-04 17:11:38 -05:00
When you have already defined a schema on a collection and you refence this in links, there's no need to extend the schema. Just use the current schema
This commit is contained in:
parent
5b4693343f
commit
2500c1a171
1 changed files with 6 additions and 4 deletions
|
@ -266,9 +266,11 @@ export default class Linker {
|
|||
if (this.mainCollection.simpleSchema && this.mainCollection.simpleSchema()) {
|
||||
const schema = createFieldSchema(this.isMany(), this.linkConfig.metadata);
|
||||
|
||||
this.mainCollection.attachSchema({
|
||||
[this.linkConfig.field]: schema
|
||||
});
|
||||
if(! this.mainCollection.simpleSchema()._schemaKeys.includes(this.linkConfig.field)) {
|
||||
this.mainCollection.attachSchema({
|
||||
[this.linkConfig.field]: schema
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -378,4 +380,4 @@ export default class Linker {
|
|||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue