File tree 1 file changed +7
-3
lines changed
website/src/docs/hotchocolate/api-reference
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,9 @@ public class CustomHttpRequestInterceptor : DefaultHttpRequestInterceptor
132
132
2 . Register ` CustomHttpRequestInterceptor ` with the root ` ServiceCollection ` .
133
133
134
134
``` csharp
135
- services .AddHttpRequestInterceptor <CustomHttpRequestInterceptor >();
135
+ services
136
+ .AddGraphQLServer ()
137
+ .AddHttpRequestInterceptor <CustomHttpRequestInterceptor >();
136
138
```
137
139
138
140
3 . Next, inherit from ` DefaultSocketSessionInterceptor ` and override ` OnRequestAsync ` .
@@ -145,7 +147,7 @@ public class CustomSocketSessionInterceptor : DefaultSocketSessionInterceptor
145
147
IQueryRequestBuilder requestBuilder ,
146
148
CancellationToken cancellationToken )
147
149
{
148
- await await OnRequestAsync (connection , requestBuilder , cancellationToken );
150
+ await OnRequestAsync (connection , requestBuilder , cancellationToken );
149
151
requestBuilder .SetServices (CUSTOM_SERVICE_PROVIDER );
150
152
}
151
153
}
@@ -154,5 +156,7 @@ public class CustomSocketSessionInterceptor : DefaultSocketSessionInterceptor
154
156
4 . Last, register your ` CustomSocketSessionInterceptor ` with the root ` ServiceCollection ` .
155
157
156
158
``` csharp
157
- services .AddSocketSessionInterceptor <CustomSocketSessionInterceptor >();
159
+ services
160
+ .AddGraphQLServer ()
161
+ .AddSocketSessionInterceptor <CustomSocketSessionInterceptor >();
158
162
```
You can’t perform that action at this time.
0 commit comments