Skip to content

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

@Luscha

Description

@Luscha

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/graphqlIssues related to GraphQL support on Dgraph.kind/bugSomething is broken.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions