extend schema
  @link(url: "https://specs.apollo.dev/federation/v2.10", import: ["@key"])
  @link(url: "https://specs.apollo.dev/connect/v0.2", import: ["@connect"])

type Query {
  "The auto-key `store` field doesn't match the explicit composite key, so that key is unresolved"
  product(id: ID!, store: StoreInput!): Product
    @connect(
      http: {
        GET: "http://myapi/region/{$args.store.country.region}/country/{$args.store.country.id}/store/{$args.store.id}/products/{$args.id}"
      }
      selection: "id store { id country { id key_id region } } name"
      entity: true
    )
}

type Product @key(fields: "id store { id country { key_id region } }") {
  id: ID!
  store: Store!
  name: String
}

type Store {
  id: ID!
  country: Country
}

type Country {
  id: ID!
  key_id: ID!
  region: Region
}

input StoreInput {
  id: ID!
  country: CountryInput!
}

enum Region {
  AMERICAS
  EUROPE
}

input CountryInput {
  id: ID!
  region: Region!
}
