rover icon indicating copy to clipboard operation
rover copied to clipboard

@interfaceObject composition warning (INCONSISTENT_INTERFACE_VALUE_TYPE_FIELD)

Open atomheartother opened this issue 2 years ago • 2 comments

Description

rover prints warnings when trying to compose an interface as an entity (as per federation 2.3.0) when that interface has any fields other than the ones declared in @key.

Steps to reproduce

Here's a minimal example:

# A.graphql
extend schema
  @link(
    url: "https://specs.apollo.dev/federation/v2.3"
    import: [
      "@key"
    ]
  )

interface Product @key(fields: "id")
{
  id: ID!
  name: String!
}

type Query {
  getProducts: [Product!]!
}
# B.graphql
extend schema
  @link(
    url: "https://specs.apollo.dev/federation/v2.3"
    import: [
      "@key"
      "@interfaceObject"
    ]
  )

type Product @key(fields: "id") @interfaceObject {
  id: ID!
}
# supergraph-config.yaml
federation_version: =2.3.0
subgraphs:
  A:
    routing_url: test
    schema:
      file: ./A.graphql
  B:
    routing_url: test
    schema:
      file: './B.graphql'

Run yarn rover supergraph compose --config supergraph-config.yaml

Expected result

rover should not print any errors, this composed schema should be valid as per https://github.com/apollographql/federation/issues/2277

Actual result

⌛ resolving SDL for subgraphs defined in ./supergraph-config.yaml
🎶 composing supergraph with Federation v2.3.0
HINT: [INCONSISTENT_INTERFACE_VALUE_TYPE_FIELD]: Field "Product.name" of interface type "Product" is defined in some but not all subgraphs that define "Product": "Product.name" is defined in subgraph "A" but not in subgraph "B".

Environment

Rover Info:
Version: 0.11.1
Install Location: /apps/home/navennee/source/multiverse/supergraph/node_modules/binary-install/node_modules/.bin/rover
OS: CentOS 7.9.2009 (Core) [64-bit]
Shell: /bin/bash
Done in 0.30s.

atomheartother avatar Feb 14 '23 17:02 atomheartother