Skip to content

Unable to compose when a schema uses @interfaceObject and another schema references it directly. #177

@prowe

Description

@prowe

The below schemas fail to compose:

According to the logs, it seems that the validation wants to move from Book/C to resolve isbn it attempts to do this via moving to Media/A but since isbn is not defined on Media (just on Book) it fails to find the field.

# Service A
type Query {
 book: Book!
}

interface Media @key(fields: "id") {
 id: ID!
}

type Book implements Media @key(fields: "id") {
 id: ID!

 isbn: String!
}
# Service B
type Media @key(fields: "id") @interfaceObject {
  id: ID!
}

type Query {
  topRatedMedia: [Media!]!
}

extend schema
  @link(
    url: "https://specs.apollo.dev/federation/v2.3"
    import: ["@key", "@interfaceObject"]
  )
#Service C
type Query {
  cBook: Book
}

type Book @key(fields: "id") {
  id: ID!
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions