Interface query returns empty array

Hi there!

I was experimenting with interfaces and auth rules and came across some weird behaviour.

Assuming we have:

interface TestInterface {
  name: String!
  extId: String! @id
}

type Test implements TestInterface @auth(
  query: {
    rule: "{ $never: \"happens\” }"
  }
) {
  id: ID!
  content: String!
}

With this I was expecting that when querying

  • queryTestInterface I get a list of Test with the interface fields
  • queryTest I get an empty array

Instead I get an empty array even when querying queryTestInterface and only if I remove the auth rule from Test I can query both TestInterface and Test(obviously). Why is that? What is the benefit of auth rules on interfaces if that does not work?

1 Like