Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dgraph do not accept valid GraphQL with inverse @dgraph directive #5744

Closed
Luscha opened this issue Jun 26, 2020 · 0 comments · Fixed by #5911
Closed

Dgraph do not accept valid GraphQL with inverse @dgraph directive #5744

Luscha opened this issue Jun 26, 2020 · 0 comments · Fixed by #5911
Labels
area/graphql Issues related to GraphQL support on Dgraph. kind/bug Something is broken.

Comments

@Luscha
Copy link

Luscha commented Jun 26, 2020

What version of Dgraph are you using?

Master

Have you tried reproducing the issue with the latest release?

v20.07

What is the hardware spec (RAM, OS)?

Steps to reproduce the issue (command/config used to run Dgraph).

Add this predicate to dgraph Schema

Object.owner uid @reverse .

then try to push the following GraphQL Schema

type Object {
   ownedBy: Person @dgraph(pred: "Object.owner")
}

type BusinessMan implements Person {
  companyName: String
}

interface Person {
    name: String
    owns: [Object] @dgraph(pred: "~Object.owner")
}

Expected behaviour and actual result.

The schema should be valid and accepted by dgraph

but dgraph refuses the schema with the following error:

couldn't rewrite mutation updateGQLSchema because input:1: Type Object; Field ownedBy: should be of type BusinessMan to be compatible with @dgraph reverse directive but is of type Person.\n
@pawanrawal pawanrawal added area/graphql Issues related to GraphQL support on Dgraph. kind/bug Something is broken. labels Jun 26, 2020
pawanrawal added a commit that referenced this issue Jul 13, 2020
… with interfaces (#5911)

Fixes #5744

There was another bug where field which map to reverse edges in Dgraph where generated as part of AddTypeInput and TypeRef. They have been excluded now as we can't perform a mutation along them. They would earlier have given an error at runtime while doing mutations in Dgraph about predicate being incorrect because it starts with ~. Apart, from that to fix #5744, we also allow interfaces implemented by the current type in the che
pawanrawal added a commit that referenced this issue Jul 14, 2020
… with interfaces (#5911)

Fixes #5744

There was another bug where field which map to reverse edges in Dgraph where generated as part of AddTypeInput and TypeRef. They have been excluded now as we can't perform a mutation along them. They would earlier have given an error at runtime while doing mutations in Dgraph about predicate being incorrect because it starts with ~. Apart, from that to fix #5744, we also allow interfaces implemented by the current type in the che

(cherry picked from commit ecec071)
parasssh pushed a commit that referenced this issue Jul 14, 2020
… with interfaces (#5911) (#5982)

Fixes #5744

There was another bug where field which map to reverse edges in Dgraph where generated as part of AddTypeInput and TypeRef. They have been excluded now as we can't perform a mutation along them. They would earlier have given an error at runtime while doing mutations in Dgraph about predicate being incorrect because it starts with ~. Apart, from that to fix #5744, we also allow interfaces implemented by the current type in the che

(cherry picked from commit ecec071)
dna2github pushed a commit to dna2fork/dgraph that referenced this issue Jul 18, 2020
… with interfaces (hypermodeinc#5911)

Fixes hypermodeinc#5744

There was another bug where field which map to reverse edges in Dgraph where generated as part of AddTypeInput and TypeRef. They have been excluded now as we can't perform a mutation along them. They would earlier have given an error at runtime while doing mutations in Dgraph about predicate being incorrect because it starts with ~. Apart, from that to fix hypermodeinc#5744, we also allow interfaces implemented by the current type in the che
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql Issues related to GraphQL support on Dgraph. kind/bug Something is broken.
2 participants