Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document field middleware #4497

Merged
merged 6 commits into from
Dec 8, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update website/src/docs/hotchocolate/execution-engine/field-middlewar…
…e.md
  • Loading branch information
michaelstaib authored Dec 8, 2021
commit aee35fe8878fcd3cc16cd61c7489ab8987455837
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,18 @@ You can create a new attribute inheriting from `ObjectFieldDescriptorAttribute`
```csharp
public class UseMyMiddlewareAttribute : ObjectFieldDescriptorAttribute
{
public UseMyMiddlewareAttribute([CallerLineNumber] int order = 0)
{
Order = order;
}

public override void OnConfigure(IDescriptorContext context,
IObjectFieldDescriptor descriptor, MemberInfo member)
{
descriptor.UseMyMiddleware();
}
}

```

The attribute can then be used like the following.
Expand Down