Skip to content

Commit

Permalink
docs(graphql): entity reference directive docˆs
Browse files Browse the repository at this point in the history
  • Loading branch information
pmelab committed Dec 21, 2022
1 parent 72a409c commit 773ab33
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/composer/amazeelabs/graphql_directives/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,22 @@ Various menu item properties.
- `@resolveMenuItemLabel`
- `@resolveMenuItemUrl`

### `@resolveEntityReference` & `@resolveEntityReferenceRevisions`

Resolve referenced entities attached to a given `field`. Will attempt to
retrieve translations matching the current host entity.

```graphql
type Query {
post(id: String!): Post @loadEntity(type: "node", id: "$id") @lang
}

type Post {
title: String! @resolveEntityLabel
related: [Post!]! @resolveEntityReference(field: "field_related")
}
```

## Extending

To add custom directives, create a module and add new Plugins in the
Expand Down

0 comments on commit 773ab33

Please sign in to comment.