I have such models (simplified): ``` type Rule { ...
# orm-help
g
I have such models (simplified):
Copy code
type Rule {
  id: ID! @unique
  name: String! @unique
  examples: [RuleExample!]! @relation(name: "RuleOnRuleExample" onDelete: CASCADE)
}

type RuleExample {
  id: ID! @unique
  correct: String!
  incorrect: String!
  rule: Rule @relation(name: "RuleOnRuleExample")
}
I created a rule with field examples - http://prntscr.com/lmdo4b And now when I'm trying to get it like this:
Copy code
query {
  rule(name: "getter-return") {
    examples {
      correct
      incorrect
    }
  }
}
I get
null
inside
examples
field. Why? Here is the code of this query:
Copy code
const rule = (_, args, context, info) => {
  return context.prisma.rule(
    args.id ? { id: args.id } : { name: args.name.toLowerCase() },
  );
};
Any ideas on this one? I have such situation everywhere.
n
Do you have a resolver for
rule.examples
?