Skip to content

Commit edb5826

Browse files
committed
added type system uml diagram and directive demo project reference
1 parent 723b6f0 commit edb5826

File tree

3 files changed

+18
-29
lines changed

3 files changed

+18
-29
lines changed

docs/advanced/directives.md

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -375,32 +375,15 @@ The benefit of ensuring your directives are part of your `IServiceCollection` sh
375375
## Understanding the Type System
376376
GraphQL ASP.NET builds your schema and all of its types from your controllers and objects. In general, you do not need to interact with it, however; when applying type system directives you are affecting the final generated schema at run time, making changes as you see fit. When doing this you are forced to interact with the internal type system.
377377

378-
Below is a list of interfaces that may prove helpful as you navigate a schema's structure. During the schema generation phase of a directive the `DirectiveTarget` will be an item that will implement one or more of these interfaces depending its nature.
379-
380-
* `ISchemaItem`
381-
* all parts of the type system inherit from `ISchemaItem` it contains basic properties such as `Name` and `Description`.
382-
* `ITypedSchemaItem`
383-
* Any schema item derived from a .NET type (controllers, POCOs, scalars etc) implement this interface and expose an `ObjectType` property giving access to the .NET `System.Type` it represents.
384-
* `ISchema`
385-
* The schema itself. Contains a `KnownTypes` collection containing all the graph types registered.
386-
* `IGraphOperation`
387-
* One of three top level operations (query, mutation, subscription). All graph operations are also object graph types.
388-
* `IGraphType`
389-
* All graph types (scalars, objects, enums, interfaces etc.) implement `IGraphType`.
390-
* `IObjectGraphType`
391-
* `IInputObjectGraphType`
392-
* Represents the two complex object types of GraphQL. Defines a `Fields` collection containing all the fields defined on the type.
393-
* `IGraphField`
394-
* Represents a single field of data on an object or input graph type. Provides direct access to the field `Resolver` as well as the ability to call `UpdateResolver()` to change it entirely. Also has an `Arguments` collection containing all the arguments the field defines.
395-
* `IGraphArgument`
396-
* A single parameter on a single field of data. Many properties of a graph argument are read-only and for informational purposes only.
397-
* `IInterfaceGraphType`
398-
* Represents the INTERFACE type of GraphQL. Defines a `Fields` collection containing all the fields available via the interface.
399-
* `IUnionGraphType`
400-
* Represents the UNION type of GraphQL. Exposes the `PossibleConcreteTypes` and `PossibleGraphTypeNames` collections containing all the allowed .NET types and schema object graph type names that the union can represent.
401-
* `IScalarGraphType`
402-
* A scalar. Contains low level data items such as `SourceResolver` for parsing data supplied on a query and `Serializer` for serializing out data results.
403-
* `IEnumGraphType`
404-
* Represents the ENUM type of GraphQL. Contains a `Values` collection with all the defined values.
405-
* `IEnumValue`
406-
* A single valid value within an ENUM graph type.
378+
**UML Diagrams**
379+
380+
These [uml diagrams](../assets/2022-05-graphql-aspnet-type-system-interface-diagrams.pdf) details the major interfaces and their most useful properties of the type system. However,
381+
these diagrams are not exaustive. Look at the [source code](https://github.com/graphql-aspnet/graphql-aspnet/tree/master/src/graphql-aspnet/Interfaces/TypeSystem) for the full definitions.
382+
383+
**Helpful Extensions**
384+
385+
There are a robust set of of built in extensions for `ISchemaItem` that can help you filter your data. See the [full source code](https://github.com/graphql-aspnet/graphql-aspnet/tree/master/src/graphql-aspnet/Configuration/SchemaItemExtensions.cs) for details.
386+
387+
## Demo Project
388+
See the [Demo Projects](../reference/demo-projects.md) page for a demonstration on creating a type system for extending a field resolver and an execution directives
389+
that manipulates a string field result at runtime.
Binary file not shown.

docs/reference/demo-projects.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@ Demonstrates fields with authorization requirements and how access denied messag
2020

2121
Demonstrates how to setup a [Firebase](https://firebase.google.com/) project and link a GraphQL ASP.NET project to it.
2222

23+
<span style="font-size:20px;vertical-align: center;">&#128204;</span>&nbsp; [Custom Directives](https://github.com/graphql-aspnet/demo-projects/tree/master/Custom-Directives)
24+
25+
Demostrates creating and applying a type system directive and a custom execution directive.
26+
27+
2328
<span style="font-size:20px;vertical-align: center;">&#128204;</span>&nbsp; [Subscriptions w/ Azure Service Bus](https://github.com/graphql-aspnet/demo-projects/tree/master/Subscriptions-AzureServiceBus)
2429

2530
Demonstrates the use of an external subscription event publisher and a consumer to deserialize and route events. Use of this demo project requires your own [Azure Service Bus](https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview) namespace.
2631

2732
<span style="font-size:20px;vertical-align: center;">&#128204;</span>&nbsp; [Subscriptions w/ React & Apollo Client](https://github.com/graphql-aspnet/demo-projects/tree/master/Subscriptions-ReactApolloClient)
2833

2934
A sample react application that makes use of the [apollo client](https://www.apollographql.com/docs/react/) to connect to a GraphQL ASP.NET server.
35+

0 commit comments

Comments
 (0)