Gorodov Maksim
11/24/2018, 11:39 AMtype 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:
query {
rule(name: "getter-return") {
examples {
correct
incorrect
}
}
}
I get null inside examples field. Why? Here is the code of this query:
const rule = (_, args, context, info) => {
return context.prisma.rule(
args.id ? { id: args.id } : { name: args.name.toLowerCase() },
);
};Gorodov Maksim
11/25/2018, 1:15 AMnuno
11/27/2018, 11:00 AMrule.examples?