1

If I have a simple schema like:

type Author @model { 
  id: ID! @isUnique 
  posts: [Post!]!  @relation(name: "AuthorOfPost")
}
type Post @model {
  id: ID! @isUnique
  author: Author @relation(name: "AuthorOfPost")
}

How can I query all Posts that do not have an author?

Unfortunately, I cannot find something in the authorFilter like id_is_null.

Peter Albert
  • 16,917
  • 5
  • 64
  • 88

1 Answers1

2

try this!

query PostsWithAuthor {
  allPosts(filter: { author: null }) {
    id
    author {
      id
    }
  }
}
maticzav
  • 880
  • 9
  • 17