You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced/subscriptions.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,15 +143,15 @@ A complete example of single instance subscription server including a react app
143
143
## Scaling Subscription Servers
144
144
Using web sockets has a natural limitation in that any each server instance has a maximum number of socket connections that it can handle. Once that limit is reached no additional clients can register subscriptions.
145
145
146
-
Ok no problem, just scale horizontally, spin up additional ASP.NET server instances and have the new requests open a web socket connection to these additional server instances, right? Not so fast.
146
+
Ok no problem, just scale horizontally, spin up additional ASP.NET server instances, add a load balancer and have the new requests open a web socket connection to these additional server instances, right? Not so fast.
147
147
148
148
With the examples above events published by any mutation using `PublishSubscriptionEvent` are routed internally directly to the local subscription server meaning only those clients connected to the server where the event was raised will receive it. Clients connected to other server instances will never know an event was raised. This represents a big problem for large scale websites, so what do we do?
149
149
150
150
### Custom Event Publishing
151
151
Instead of publishing events internally, within the server instance, we need to publish our events to some intermediate source such that any server can be notified of the change. There are a variety of technologies to handle this scenario; be it a common database or messaging technologies like RabbitMQ, Azure Service Bus etc.
152
152
153
153
#### Implement `ISubscriptionEventPublisher`
154
-
Whatever your technology of choice the first step is to create and register a custom publisher such that any raised events are published externally. How your individual class functions will vary widely depending on your implementation.
154
+
Whatever your technology of choice the first step is to create and register a custom publisher. How your individual class functions will vary widely depending on your implementation.
-`TypeExpression` - Define a custom type expression; useful in setting a normally optional input field (such as a string or other object) to being required.
Indicates that the controller should not attempt to register a virtual field for itself and that all methods should be extended off the their respective root types.
Copy file name to clipboardExpand all lines: docs/reference/schema-configuration.md
+15-12Lines changed: 15 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,9 @@ Adds the single graph entity to the schema. Use this method to add individual ty
45
45
schemaOptions.AddSchemaAssembly()
46
46
```
47
47
48
-
When using .`AddGraphQL<TSchema>()` on multi-schema servers, the runtime will scan the assembly where the schema is declared and auto-include any found graph entities (controllers, types enums etc.) on the schema.
48
+
When declaring a new schema with .`AddGraphQL<TSchema>()`, the runtime will scan the assembly where `TSchema` is declared and auto-add any found graph entities (controllers, types enums etc.) to the schema.
49
+
50
+
This method has no effect when using `AddGraphQL()`.
49
51
50
52
### AddGraphAssembly
51
53
@@ -54,7 +56,7 @@ When using .`AddGraphQL<TSchema>()` on multi-schema servers, the runtime will sc
54
56
schemaOptions.AddGraphAssembly(Assembly)
55
57
```
56
58
57
-
The runtime will scan the referenced assembly and auto-include any found graph entities (controllers, types enums etc.) on the schema.
59
+
The runtime will scan the referenced assembly and auto-add any found graph entities (controllers, types enums etc.) to the schema.
When true those graph entities (controllers, types, enums etc.) that are declared in the entry assembly for the application are automatically registered to the schema.
71
+
When true, those graph entities (controllers, types, enums etc.) that are declared in the entry assembly for the application are automatically registered to the schema. Typically this is your API project where `Startup.cs` is declared.
70
72
71
73
## Authorization Options
72
74
@@ -84,7 +86,7 @@ Controls how the graphql execution pipeline will authorize a request.
84
86
85
87
*`PerField`: Each field of a query is evaluated individually allowing a data response to be generated that includes data the user can access and `null` values for those fields the user cannot access. Any unauthorized fields will also register an error in the response.
86
88
87
-
*`PerRequest`: All fields of a query are validated BEFORE execution. If the current user does not have access to 1 or more fields the entire request is denied and an error message generated.
89
+
*`PerRequest`: All fields of a query are validated BEFORE execution. Each field is validated individually, using its own authorization and authentication requirements. If the current user does not have access to 1 or more requested fields the entire request is denied and an error message generated.
88
90
89
91
> See [Subscription Security](../advanced/subscriptions#security--query-authorization) for additional considerations regarding authorization and subscriptions.
90
92
@@ -138,6 +140,7 @@ An object that will format any internal name of a class or method to an acceptab
138
140
| Enum Values | All Caps |`CHOCOLATE`, `FEET`, `PHONE_NUMBER`|
139
141
_Default formats for the three different entity types_
140
142
143
+
> To make radical changes to your name formats, beyond the available options, inherit from `GraphNameFormatter` and override the different formatting methods.
When true, metrics / query profiling will be enabled for all queries processed for a given schema.
157
+
When true, metrics and query profiling will be enabled for all queries processed for a given schema.
155
158
156
159
### QueryTimeout
157
160
@@ -170,14 +173,14 @@ The amount of time an individual query will be given to run to completion before
170
173
171
174
```csharp
172
175
// usage examples
173
-
schemaOptions.ExecutionOptions.DebugMode=true;
176
+
schemaOptions.ExecutionOptions.DebugMode=false;
174
177
```
175
178
176
179
| Default Value | Acceptable Values |
177
180
| ------------- | ----------------- |
178
181
|`false`|`true`, `false`|
179
182
180
-
When true, each field and each list member of each field will be executed sequentially rather than asynchronously. All asynchronous methods will be individually awaited and allowed to throw immediately. A single encountered exception will halt the entire query process. This can be very helpful in preventing a jumping debug cursor as queries are normally executed in parallel. This option will greatly impact performance and should only be enabled for [debugging](../development/debugging).
183
+
When true, each field and each list member of each field will be executed sequentially rather than asynchronously. All asynchronous methods will be individually awaited and allowed to throw immediately. A single encountered exception will halt the entire query process. This can be very helpful in preventing a jumping debug cursor as query branches are normally executed in parallel. This option will greatly impact performance and can cause inconsistent query results if used in production. It should only be enabled for [debugging](../development/debugging).
The allowed [field depth](../execution/malicious-queries) of any child field within a given query. If a child is nested deeper than this value the query will be rejected.
209
+
The maximum allowed [field depth](../execution/malicious-queries) of any child field within a given query. If a child is nested deeper than this value the query will be rejected.
Represents the http end point where GraphQL will listen for new requests. In multi-schema configurations this value will need to be unique per schema type.
316
+
Represents the REST end point where GraphQL will listen for new POST requests. In multi-schema configurations this value will need to be unique per schema type.
When true, only those requests that are successfully authenticated by the ASP.NET runtime will be passed to graphQL. Should an unauthenticated request make it to the graphql query processor it will be immediately rejected. This option has no effect when a custom `HttpProcessorType` is declared.
329
+
When true, only those requests that are successfully authenticated by the ASP.NET runtime will be passed to GraphQL. Should an unauthenticated request make it to the graphql query processor it will be immediately rejected. This option has no effect when a custom `HttpProcessorType` is declared.
When set to a type, GraphQL will attempt to load the provided type from the configured DI container in order to handle graphql requests. Any class wishing to act as an Http Processor must inherit from `IGraphQLHttpProcessor`. It is perhaps easier to extend `DefaultGraphQLHttpProcessor<TSchema>` for most small operations such as handling metrics.
342
+
When set to a type, GraphQL will attempt to load the provided type from the configured DI container in order to handle graphql requests. Any class wishing to act as an Http Processor must implement `IGraphQLHttpProcessor`. In most cases it may be easier to extend `DefaultGraphQLHttpProcessor<TSchema>`.
340
343
341
344
## Subscription Server Options
342
345
These options are available to configure a subscription server for a given schema via `.AddSubscriptions(serverOptions)` or `.AddSubscriptionServer(serverOptions)`
When true, GraphQL will not register a component to listen for web socket requests. You must handle the acceptance of web sockets yourself and inform the subscription server that a new one exists. If you wish to implement your own web socket middleware handler, viewing `DefaultGraphQLHttpSubscriptionMiddleware<TSchema>` may help.
357
+
When true, GraphQL will not register a component to listen for web socket requests. You must handle the acceptance of web sockets yourself and inform the subscription server that a new one exists. If you wish to implement your own web socket middleware handler, viewing [DefaultGraphQLHttpSubscriptionMiddleware<TSchema>](https://github.com/graphql-aspnet/graphql-aspnet/blob/master/src/graphql-aspnet-subscriptions/Defaults/DefaultGraphQLHttpSubscriptionMiddleware.cs) may help.
0 commit comments