Fix(GraphQL): Ignore redundant references to inverse object in mutation rewriting#7469
Fix(GraphQL): Ignore redundant references to inverse object in mutation rewriting#7469
Conversation
JatinDev543
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @abhimanyusinghgaur, @pawanrawal, and @vmrajas)
graphql/resolve/add_mutation_test.yaml, line 4170 at r1 (raw file):
"dgraph.type":["Foo"], "uid":"_:Foo3" }
can you please add test(if not already present) where we have nested fields but they are not inverse.
For example with below schema
type Foo {
id: String! @id
bar: Bar!
}
type Bar {
id: String! @id
foo: Foo!
}
mutation addBar($input: [AddBarInput!]!) {
addBar(input: $input) {
bar {
id
foo {
id
bar{
id
}
}
}
}
}
JatinDev543
left a comment
There was a problem hiding this comment.
Reviewed 3 of 3 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @pawanrawal and @vmrajas)
vmrajas
left a comment
There was a problem hiding this comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jatindevdg and @pawanrawal)
graphql/resolve/add_mutation_test.yaml, line 4170 at r1 (raw file):
Previously, JatinDevDG (Jatin Dev) wrote…
can you please add test(if not already present) where we have nested fields but they are not inverse.
For example with below schema
type Foo {
id: String! @id
bar: Bar!
}
type Bar {
id: String! @id
foo: Foo!
}mutation addBar($input: [AddBarInput!]!) { addBar(input: $input) { bar { id foo { id bar{ id } } } } }
There exists such a test in add_mutation_test.yaml by the name, "Deep mutation three level xid with no initial XID" .
It adds Post1 ->linking it to -> Comment1 -> linking it to another Comment1 as reply .There are no inverses.
440fdb8 to
73b1cb2
Compare
After the refactoring of mutation rewriting, references to inverse objects were not ignored in existenceQueries function. This PR fixes this.
This PR fixes https://discuss.dgraph.io/t/bug-not-sure-how-to-name-this-bug-please-help-out/12845
Testing:
This change is