Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions spec/Section 2 -- Source Schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,23 @@ type Product @key(fields: "id") {
}
```

For a given source schema, there must be exactly one non-deprecated lookup field
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to move this to the validation section.

that can resolve a given entity by a specific key. If multiple non-deprecated
lookup fields are defined that resolve the same entity by the same key, the
composition process must throw a composition error.

```graphql counter-example
type Query {
product(id: ID!): Product @lookup
productV2(id: ID!): Product @lookup
}

type Product @key(fields: "id") {
id: ID!
sku: String!
}
```

Lookups can also be nested within other lookups and allow resolving nested
entities that are part of an aggregate. In the following example the `Product`
can be resolved by its ID but also the `ProductPrice` can be resolved by passing
Expand Down