Skip to content

Expected Iterable, but did not find one for field #55

Description

@BarryThePenguin

When a schema defines a list using an interface, it looks like @miragejs/graphql fails to build the field for the list

interface ItemRead {
  authors: [String!]!
  id: ID!
  title: String!
}

type BookChapterRead implements ItemRead {
  authors: [String!]!
  chapter: Int
  id: ID!
  title: String!
}

type BookRead implements ItemRead {
  authors: [String!]!
  id: ID!
  rating: Int
  title: String!
}

type Query {
  booksRead: [BookRead]
  bookChapterRead: [BookChapterRead]
  itemsRead: [ItemRead]
}

Querying for..

{
  itemsRead {
    id
    title
    authors
  }
}

..fails with..

Expected Iterable, but did not find one for field "Query.itemsRead".

..while querying other fields works fine.

I put together a reproduction in the REPL https://miragejs.com/repl/v2/042996bcd5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions