Skip to content

Commit

Permalink
v6.33.0
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Feb 1, 2024
1 parent 24cec48 commit a97436f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ You can find and compare releases at the [GitHub release page](https://github.co

## Unreleased

## v6.33.0

### Added

- Resolve all pivot attributes https://github.com/nuwave/lighthouse/pull/2464
- Expose pivot field on pagination edge https://github.com/nuwave/lighthouse/pull/2464

## v6.32.0

Expand Down
21 changes: 20 additions & 1 deletion docs/6/api-reference/directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ type RoleUserPivot {
```

When using the `type` argument with pagination style `CONNECTION`, you may create your own [edge type](https://facebook.github.io/relay/graphql/connections.htm#sec-Edge-Types)
that contains the attributes of the intermediate table.
that either contains the attributes of the intermediate table or contains a `pivot` field with the corresponding type.

The custom edge type must contain at least the following two fields:

Expand All @@ -441,6 +441,25 @@ type RoleEdge {
}
```

As an alternative, you can also expose the `pivot` field on the edge:

```graphql
type User {
roles: [Role!]! @belongsToMany(type: CONNECTION)
}

type UserRole {
meta: String
}

type RoleEdge {
node: Role!
cursor: String!
pivot: UserRole
}
```


## @broadcast

```graphql
Expand Down

0 comments on commit a97436f

Please sign in to comment.