Skip to content

Commit

Permalink
Added Patch
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Jun 6, 2024
1 parent b9b6aa2 commit 628592c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions spec/Section 2 -- Source Schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,32 @@ type Repository @key(fields: "id organization { id }") {
}
```

### @patch

```graphql
directive @patch on FIELD_DEFINITION
```

The `@patch` directive is used within a _source schema_ to specify object fields
that can be used by the _distributed GraphQL executor_ to resolve additional
data for an entity rather than fetching the entity itself. A patch resolver
result does noth mean that the actual entity exists.

```graphql example
type Query {
personById(id: ID!): Person @patch
personByName(name: String!): Person @patch
}

type Person @key(fields "id") @key(fields "name") {
id: ID!
name: String!
}
```

Patch resolve as oposed to lookup fields will be omitted from the _composite
schema_ but will be referenced within the _composite execution schema_.

### @is

```graphql
Expand Down

0 comments on commit 628592c

Please sign in to comment.