Skip to content

Commit

Permalink
Merge pull request #1253 from ewen-lbh/patch-1
Browse files Browse the repository at this point in the history
docs: mention relay plugin's builder.nodeInterfaceRef
  • Loading branch information
hayes authored Jul 22, 2024
2 parents 0fdcfd5 + 0eb78c5 commit 3c55a87
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions website/content/docs/plugins/relay.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -773,3 +773,17 @@ const ThingsConnection = builder.connectionObject({
nodeNullable: false,
});
```

### Extending the `Node` interface

Use the `nodeInterfaceRef` method of your Builder.

For example, to add a new derived field on the interface:

```ts
builder.interfaceField(builder.nodeInterfaceRef(), 'extra', (t) =>
t.string({
resolve: () => 'it works',
})
);
```

0 comments on commit 3c55a87

Please sign in to comment.