Skip to content

Commit 7f695cd

Browse files
Update Action Workflows (#33)
Changed the "publish to" branch to be "gh-pages" instead of "master"
1 parent f61dc4d commit 7f695cd

File tree

5 files changed

+37
-21296
lines changed

5 files changed

+37
-21296
lines changed

.github/workflows/deploy-website.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- develop
7-
# Review gh actions docs if you want to further define triggers, paths, etc
8-
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
97

108
jobs:
119
deploy:
@@ -23,16 +21,12 @@ jobs:
2321
- name: Build website
2422
run: yarn build
2523

26-
# Popular action to deploy to GitHub Pages:
27-
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
2824
- name: Deploy to GitHub Pages
2925
uses: peaceiris/actions-gh-pages@v3
3026
with:
31-
github_token: ${{ secrets.BOT_DEPLOYMENT_TOKEN }}
32-
# Build output to publish to the `gh-pages` branch:
27+
github_token: ${{ secrets.BOT_DEPLOYMENT_TOKEN }}
3328
publish_dir: ./build
34-
35-
publish_branch: master
29+
publish_branch: gh-pages
3630

3731
# The following lines assign commit authorship to the official
3832
# GH-Actions bot for deploys to `gh-pages` branch:

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55
**Primary Repo**: [https://github.com/graphql-aspnet/graphql-aspnet](https://github.com/graphql-aspnet/graphql-aspnet)
66

7-
This repository contains the source code for the GraphQL ASP.NET documentation website. Clone the `develop` branch to view the code and update the documentation. The `master` branch contains the compiled static site served by github pages.
7+
This repository contains the source code for the GraphQL ASP.NET documentation website.
8+
9+
## How to Run The Docs Locally
10+
0. Clone the `develop` branch
11+
1. Open a terminal at the repo directory
12+
2. Execute `yarn install`
13+
3. Execute `yarn start`
14+
4. Website starts on `http://localhost:3000` by default
815

916

1017
_Documentation created using [Docusaurus v2](https://docusaurus.io)_

docs/advanced/multiple-schema.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ services.AddGraphQL<SchemaType>();
3333

3434
### Give Each Schema its Own HTTP Route
3535

36-
The query handler will attempt to register a schema to `/graphql` for its URL, you'll want to ensure that each schema has its own endpoint by updating the individual routes.
36+
The query handler will attempt to register a schema to `/graphql` as its URL by default; you'll want to ensure that each schema has its own endpoint by updating the individual routes.
3737

3838
```csharp title="Adding Multiple Schemas"
3939
services.AddGraphQL<EmployeeSchema>((options) =>
@@ -52,4 +52,12 @@ services.AddGraphQL<CustomerSchema>((options) =>
5252

5353
## Disable Local Graph Entity Registration
5454

55-
You'll most likely want to disable registering of local graph entities (the entities in the startup assembly) on one or both schemas lest you want each schema contain those controllers and graph types.
55+
You may want to disable the registering of local graph entities (the entities in the startup assembly) on one or both schemas lest you want each schema to contain the same controllers and graph types.
56+
57+
```csharp title="Startup Code"
58+
// Optionally Disable Local Entity Registration
59+
services.AddGraphQL<EmployeeSchema>(o =>
60+
{
61+
o.AutoRegisterLocalEntities = false;
62+
});
63+
```

docs/reference/middleware.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ schemaBuilder.QueryExecutionPipeline.AddMiddleware<MyQueryMiddleware>();
7777

7878
Instead of adding to the end of the existing pipeline you can also call `.Clear()` to remove the default components and rebuild the pipeline from scratch. See below for the list of default middleware components and their order of execution. This can be handy when needing to inject a new component into the middle of the execution chain.
7979

80-
> Modifying the pipeline component order can cause unwanted side effects, including breaking the library such that it no longer functions. Take care when adding or removing middleware components.
80+
:::caution Component order Matters
81+
Modifying the component order of a pipeline can cause unwanted side effects, including breaking the library such that it no longer functions. Take care when adding or removing middleware components.
82+
:::
8183

8284
## The Context Object
8385

@@ -89,16 +91,18 @@ Each context object has specific data fields required for it to perform its work
8991
- `IsValid`: Determines if the context is in a valid and runnable state. Most middleware components will not attempt to process the context if its not in a valid state and will simply forward the request on. By default, a context is automatically invalidated if an error message is added with the `Critical` severity.
9092
- `SecurityContext`: The information received from ASP.NET containing the credentials of the active user. May be null if user authentication is not setup for your application.
9193
- `Metrics`: The metrics package performing any profiling of the query. Various middleware components will stop/start phases of execution using this object. If metrics are not enabled this object will be null.
92-
- `Items`: A key/value pair collection of items. This field is developer driven and not used by the runtime.
94+
- `Items`: A key/value collection of items available to every context on every pipeline related to a single request. This field is developer driven and not used by the runtime.
9395
- `Logger`: An `IGraphEventLogger` instance scoped to the the current query.
9496

9597
## Middleware is served from the DI Container
9698

97-
Each pipeline is registered as a singleton instance in your service provider but the components within the pipeline are invoked according to the service lifetime you supply when you register them allowing you to setup dependencies as necessary.
99+
Each pipeline is registered as a singleton instance in your service provider but the components within the pipeline are invoked according to the service lifetime you supply when you register them, allowing you to manage dependencies as you see fit.
98100

99-
> Register your middleware components with the `Singleton` lifetime scope whenever possible.
101+
:::tip Register Middleware as Singletons
102+
Register your middleware components with the `Singleton` lifetime scope whenever possible to boost performance.
103+
:::
100104

101-
It is recommended that your middleware components be singleton in nature if possible. The field execution and item authorization pipelines can be invoked many dozens of times per request and fetching new middleware instances for each invocation can impact performance. The internal pipeline manager will retain references to any singleton middleware components once they are generated and avoid this bottleneck whenever possible. Most default components are registered as a singletons.
105+
It is recommended that your middleware components be singleton in nature if possible. The field execution and item authorization pipelines can be invoked many dozens of times per request and fetching new middleware instances for each invocation can impact performance. Most default components are registered as a singletons.
102106

103107
## Query Execution Pipeline
104108

@@ -215,5 +219,11 @@ public class GraphDirectiveExecutionContext
215219
- `Directive`: The specific `IDirective`, registered to the schema, that is being processed.
216220
- `Schema`: the schema instance where the directive is declared.
217221

218-
> WARNING: Since the directive execution pipeline is used to construct the schema and apply type system directives, middleware components cannot inject a schema instance
219-
> from the DI container. To do so will cause a circular reference. Instead use the schema instance attached to the `GraphDirectiveExecutionContext`. The state of this schema object is not guaranteed at during schema generation as it will continue to change as type system directives are applied by the pipeline.
222+
### A Note on Schema Instances
223+
Since the directive execution pipeline is used to construct a schema and apply type system directives, middleware components within it cannot inject a schema instance from the DI container. To do so would cause a circular reference in the DI container.
224+
225+
Instead use the schema instance attached to the `GraphDirectiveExecutionContext`.
226+
227+
:::note
228+
You can inject a schema instance into components of every pipeline EXCEPT the Directive Execution Pipeline.
229+
:::

0 commit comments

Comments
 (0)