Skip to content

Commit 327f7e2

Browse files
minor updates to paragraphs, bumped version number (#10)
1 parent 6686ddc commit 327f7e2

File tree

4 files changed

+31
-16
lines changed

4 files changed

+31
-16
lines changed

docs/advanced/subscriptions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ A complete example of single instance subscription server including a react app
143143
## Scaling Subscription Servers
144144
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.
145145

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.
147147

148148
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?
149149

150150
### Custom Event Publishing
151151
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.
152152

153153
#### 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.
155155

156156
```C#
157157
public interface ISubscriptionEventPublisher

docs/reference/attributes.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ Acts to explicitly declare a method or property as being part of a graph type.
210210
#### `[GraphField(name)]`
211211

212212
- `name` - The name of this field as it should appear in the object graph to be queried
213-
214213
```csharp
215214
public class Human
216215
{
@@ -221,6 +220,19 @@ public class Human
221220
}
222221
```
223222

223+
#### `[GraphField(TypeExpression = TypeExpressions.IsNotNull)]`
224+
- `TypeExpression` - Define a custom type expression; useful in setting a normally optional input field (such as a string or other object) to being required.
225+
226+
```csharp
227+
public class Human
228+
{
229+
public int Id{get; set; }
230+
231+
[GraphField(TypeExpression = TypeExpressions.IsNotNull)]
232+
public Employer Boss { get; set; }
233+
}
234+
```
235+
224236
## GraphRoot
225237

226238
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.

docs/reference/schema-configuration.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ Adds the single graph entity to the schema. Use this method to add individual ty
4545
schemaOptions.AddSchemaAssembly()
4646
```
4747

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()`.
4951

5052
### AddGraphAssembly
5153

@@ -54,7 +56,7 @@ When using .`AddGraphQL<TSchema>()` on multi-schema servers, the runtime will sc
5456
schemaOptions.AddGraphAssembly(Assembly)
5557
```
5658

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.
5860

5961
### AutoRegisterLocalGraphEntities
6062
```csharp
@@ -66,7 +68,7 @@ schemaOptions.AutoRegisterLocalGraphEntities = true;
6668
| ------------- | ----------------- |
6769
| `true` | `true`, `false` |
6870

69-
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.
7072

7173
## Authorization Options
7274

@@ -84,7 +86,7 @@ Controls how the graphql execution pipeline will authorize a request.
8486

8587
* `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.
8688

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.
8890

8991
> See [Subscription Security](../advanced/subscriptions#security--query-authorization) for additional considerations regarding authorization and subscriptions.
9092
@@ -138,6 +140,7 @@ An object that will format any internal name of a class or method to an acceptab
138140
| Enum Values | All Caps | `CHOCOLATE`, `FEET`, `PHONE_NUMBER` |
139141
_Default formats for the three different entity types_
140142

143+
> To make radical changes to your name formats, beyond the available options, inherit from `GraphNameFormatter` and override the different formatting methods.
141144
142145
## Execution Options
143146

@@ -151,7 +154,7 @@ schemaOptions.ExecutionOptions.EnableMetrics = false;
151154
| ------------- | ----------------- |
152155
| `false` | `true`, `false` |
153156

154-
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.
155158

156159
### QueryTimeout
157160

@@ -170,14 +173,14 @@ The amount of time an individual query will be given to run to completion before
170173

171174
```csharp
172175
// usage examples
173-
schemaOptions.ExecutionOptions.DebugMode = true;
176+
schemaOptions.ExecutionOptions.DebugMode = false;
174177
```
175178

176179
| Default Value | Acceptable Values |
177180
| ------------- | ----------------- |
178181
| `false` | `true`, `false` |
179182

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).
181184

182185
### ResolverIsolation
183186

@@ -203,7 +206,7 @@ schemaOptions.ExecutionOptions.MaxQueryDepth = 15;
203206
| ------------- | ---------------------- |
204207
| -_not set_- | Integer Greater than 0 |
205208

206-
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.
207210

208211
### MaxQueryComplexity
209212

@@ -310,7 +313,7 @@ schemaOptions.QueryHandler.Route = "/graphql";
310313
| ------------- |
311314
| `/graphql` |
312315

313-
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.
314317

315318
### AuthenticatedRequestsOnly
316319

@@ -323,7 +326,7 @@ schemaOptions.QueryHandler.AuthenticatedRequestsOnly = false;
323326
| ------------- | ----------------- |
324327
| `false` | `true`, `false` |
325328

326-
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.
327330

328331
### HttpProcessorType
329332

@@ -336,7 +339,7 @@ schemaOptions.QueryHandler.HttpProcessorType = typeof(MyProcessorType);
336339
| ------------- |
337340
| `null` |
338341

339-
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>`.
340343

341344
## Subscription Server Options
342345
These options are available to configure a subscription server for a given schema via `.AddSubscriptions(serverOptions)` or `.AddSubscriptionServer(serverOptions)`
@@ -351,7 +354,7 @@ serverOptions.DisableDefaultRoute = false;
351354
| ------------- | ----------------- |
352355
| `false ` | `true`, `false` |
353356

354-
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.
355358

356359

357360
### Route

website/pages/en/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class HomeSplash extends React.Component {
3131
<h2 className="projectTitle">
3232
{<span>GraphQL ASP.NET</span>}
3333
{/*<small>{siteConfig.tagline}</small>*/}
34-
<small>v0.9.1-beta</small>
34+
<small>v0.9.2-beta</small>
3535
</h2>
3636
);
3737

0 commit comments

Comments
 (0)