console/packages/libraries/cli/examples/federation.reviews.graphql
Kamil Kisiela dc3bc1ec87 Hello
2022-05-18 09:26:57 +02:00

20 lines
500 B
GraphQL

extend type Product @key(fields: "id") {
id: ID! @external
reviews: [Review]
reviewSummary: ReviewSummary
}
"""
This is an Entity, docs:https://www.apollographql.com/docs/federation/entities/
You will need to define a __resolveReference resolver for the type you define, docs: https://www.apollographql.com/docs/federation/entities/#resolving
"""
type Review @key(fields: "id") {
id: ID!
rating: Float
content: String
}
type ReviewSummary {
totalReviews: Int
averageRating: Float
}