Predicate doesn't show up in Ratel Schema when reverse linked to a predicate in Interface

Hi Team,

In the following example:

type User {
    saved: [Post!] @hasInverse(field: savedBy)
}

interface Post {
    id: ID!
    savedBy: [User!] @hasInverse(field: saved)
}

type Illustration implements Post {
}

Post.savedBy shows up in Ratel Schema, but User.saved is not!

I think this is an internal thing of the GraphQL feature. It deals differently from Dgraph. But you can add it manually via alter endpoint or bulk edit on Ratel’s schema panel.

Before doing something, check what the type it would be. Not sure what Dgraph creates in the schema related to graphql’s interface. Once you know it, you can add
e.g:

type Post { #this is just an example.
  <~post.saved>
}

It seems to be a major issue when the schema wants a field to be linked to a single node implementig an interface:

interface Speaker {
  voices: [VoiceActing!]!
}

type VoiceActing implements Metadata {
  character: Speaker! @hasInverse(field: voices)
  actor: Person @hasInverse(field: voiceActings)
  isPrimary: Boolean!
}

The predicate VoiceActing.character is not inserted in ratel and skiped. This implies that the first time we insert a node with that predicate dgraph will automatically add it with the type [uid]

Which will break graphql because during the query dgraph will return an array of Speaker, missmatching with the schema definition

if you have a bug to report, please fill up an issue at Dgraph’s Github repo. Otherwise, please, create a new topic to discuss your point. As this post is marked as solved, folks will think that this is just a conversation.

Cheers.