Open
Description
There are two examples of @provides
usage that are not covered by the spec for the "External Unused" rule:
Sub-selections:
type Review {
id: ID!
product: Product @provides(fields: "sku variation { size }")
}
type Product @key(fields: "sku variation { id }") {
sku: String! @external
variation: ProductVariation!
name: String!
}
type ProductVariation {
id: String!
size: String! @external
}
The spec algorithm fails here, since it expects a @provides
directive on a field returning ProductVariation
.
Fragments:
type Review {
id: ID!
# The @provides directive tells us that this source schema can supply different
# fields depending on which concrete type of Product is returned.
product: Product
@provides(
fields: """
... on Book { author }
... on Clothing { size }
"""
)
}
interface Product @key(fields: "id") {
id: ID!
}
type Book implements Product {
id: ID!
title: String!
author: String! @external
}
type Clothing implements Product {
id: ID!
name: String!
size: String! @external
}
type Query {
reviews: [Review!]!
}
The spec doesn't include an example like this, which might be useful, even though the algorithm doesn't really define how "references field in @provides
" is actually implemented.
Metadata
Metadata
Assignees
Labels
No labels