Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Dec 27, 2024
1 parent a08ab0c commit ac1ee96
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions spec/Section 2 -- Source Schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,23 +557,21 @@ directive @external on FIELD_DEFINITION
```

The @external directive indicates that a field is recognized by the current
source schema but is not directly contributed (resolved) by it. Instead,
this schema references the field for specific composition purposes.
source schema but is not directly contributed (resolved) by it. Instead, this
schema references the field for specific composition purposes.

**Entity Keys**

When combined with one or more `@key` directives, an external
field can serve as an entity identifier (or part of a composite identifier).
When combined with one or more `@key` directives, an external field can serve as
an entity identifier (or part of a composite identifier).

```graphql example
type Query {
productBySku(sku: String!): Product @lookup
productByUpc(upc: String!): Product @lookup
}

type Product
@key(fields: "sku")
@key(fields: "upc") {
type Product @key(fields: "sku") @key(fields: "upc") {
sku: String! @external
upc: String! @external
name: String
Expand All @@ -582,7 +580,8 @@ type Product

**Field Resolution**

When another field in the same source schema uses `@provides` to declare that it can resolve certain external fields in a single data-fetching step.
When another field in the same source schema uses `@provides` to declare that it
can resolve certain external fields in a single data-fetching step.

```graphql example
type Review {
Expand All @@ -600,8 +599,8 @@ extend type User {
When a field is marked `@external`, the composition process understands that the
field belongs to another source schema. The current source schema references it
only for entity identification (via `@key`) or for providing a field through
`@provides`. If no such usage exists, the presence of an @external field
would produce a composition error.
`@provides`. If no such usage exists, the presence of an @external field would
produce a composition error.

### @override

Expand Down

0 comments on commit ac1ee96

Please sign in to comment.