Skip to content

Commit 345b44d

Browse files
author
Marco Franceschi
committed
fix: Added inverse relation to ruleMetadata
1 parent d3d4eba commit 345b44d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/rules-engine/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,14 @@ export default class RulesProvider implements Engine {
209209
MISSING
210210
SKIPPED
211211
}
212+
212213
type ${this.providerName}Findings @key(fields: "id") {
213214
id: String! @id
214215
${this.entityName}Findings: [${this.providerName}${
215216
this.entityName
216217
}Findings]
217218
}
219+
218220
type ruleMetadata @key(fields: "id") {
219221
id: String! @id @search(by: [hash, regexp])
220222
severity: String! @search(by: [hash, regexp])
@@ -224,13 +226,16 @@ export default class RulesProvider implements Engine {
224226
rationale: String @search(by: [hash, regexp])
225227
remediation: String @search(by: [hash, regexp])
226228
references: [String] @search(by: [hash, regexp])
229+
findings: [baseFinding] @hasInverse(field: rule)
227230
}
231+
228232
interface baseFinding {
229233
id: String! @id
230234
resourceId: String @search(by: [hash, regexp])
231-
rule: ruleMetadata
235+
rule: [ruleMetadata] @hasInverse(field: findings)
232236
result: FindingsResult @search
233237
}
238+
234239
type ${this.providerName}${
235240
this.entityName
236241
}Findings implements baseFinding @key(fields: "id") {

0 commit comments

Comments
 (0)