Skip to content

Commit 5fd592d

Browse files
Merge pull request #2660 from choco14t/docs/graphql-field-middleware
docs(graphql): add warning section for field middleware
2 parents 9669bf3 + 73e99e0 commit 5fd592d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

content/graphql/field-middleware.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ Now whenever we request the `title` field of `Recipe` object type, the original
4343

4444
> info **Hint** To learn how you can implement a field-level permissions system with the use of [extensions](/graphql/extensions) feature, check out this [section](/graphql/extensions#using-custom-metadata).
4545
46+
> warning **Warning** Field middleware can be applied only to `ObjectType` classes. For more details, check out this [issue](https://github.com/nestjs/graphql/issues/2446).
47+
4648
Also, as mentioned above, we can control the field's value from within the middleware function. For demonstration purposes, let's capitalise a recipe's title (if present):
4749

4850
```typescript

0 commit comments

Comments
 (0)