Skip to content

Commit

Permalink
Add docs spellcheck and fix all spelling errors (ChilliCream#5461)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanKilleen authored Oct 8, 2022
1 parent 20ac50a commit 6869a40
Show file tree
Hide file tree
Showing 113 changed files with 446 additions and 365 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/docs-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Documentation Checks

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
# linting:
# name: "Markdown linting"
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# name: Check out the code
# - name: "Docs: Markdown Linting"
# uses: docker://ghcr.io/igorshubovych/markdownlint-cli:latest
# with:
# args: 'markdownlint "./website/src/**/*.md" --disable MD013'
spellcheck:
name: "Docs: Spellcheck"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out the code
- uses: actions/setup-node@v1
name: Setup node
with:
node-version: "16"
- run: npm install -g cspell
name: Install cSpell
- run: cspell --config ./cSpell.json "website/src/**/*.md" --no-progress
name: run cSpell
70 changes: 34 additions & 36 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Return argument value as field definition runtimeType if requested as object typ

- Custom type inspectors can now again add custom ignores. #3399
- Fixed issue where descriptor attributes on resolvers were ignored. (#3892)
- Fixed that the socket interceptor `OnCloseAsync` method was not invoked. (#3951)
- Fixed that the socket interceptor `OnCloseAsync` method was not invoked. (#3951)
- Fixed MongoDB `totalCount` handling (#3880).
- Fixed handling of enums that contain underscore. (#4056)
- Fixed ignoring fields with `ObjectTypeExtensions.Ignore`. (#4034)
Expand Down Expand Up @@ -55,7 +55,7 @@ Return argument value as field definition runtimeType if requested as object typ
- Introduced nodes field. (#4000)
- Introduced field middleware order validation for HotChocolate.Data and paging middleware (#4012).
- Introduced `AggregateError` to allow rewriting a single error into multiple errors. (#4014)
- Enhanced error handling for variables to better pinpoint the actual error. (#4037)
- Enhanced error handling for variables to better pinpoint the actual error. (#4037)
- Added `RequestContext` pooling. (#4141)
- Reworked schema-first APIs to align with code-first APIs.
- Added support for `HotChocolate.Data` and paging attributes to schema-first.
Expand All @@ -77,14 +77,14 @@ Return argument value as field definition runtimeType if requested as object typ
- Added the ability to control the XML documentation file name when inferring documentation from the runtime types. (#4149)
- Added a unified cache to DataLoader.

#### Changed
#### Changed

- Reworked scalar defaults for URL and UUID. (#3822)
- Reworked dependency injection of Hot Chocolate extensions to automatically inject application dependencies. (#3833)
- Deprecated `Schema.Create`. (#3885)
- Deprecated ObjectFieldDescriptor.Resolver() overloads.
- Split the` EnableRelaySupport` configuration method into two separate APIs that allow to opt-into specific relay schema features. (#3972)
- Moved DataLoader code out of `HotChocolate.Types` into `GreenDonut`. (#4015)
- Split the`EnableRelaySupport` configuration method into two separate APIs that allow to opt-into specific relay schema features. (#3972)
- Moved DataLoader code out of `HotChocolate.Types` into `GreenDonut`. (#4015)
- Optimized subscription message receive handler. (#4143)
- Improved execution of batches during processing.
- Improved async work processing (#4006)
Expand All @@ -111,30 +111,30 @@ Return argument value as field definition runtimeType if requested as object typ
### Added

- Additional HotChocolate scalars (HotChocolate.Types.Scalars)
- PhoneNumber (#2995)
- EmailAddress (#2989)
- NegativeFloat (#2996)
- NonPositiveFloat (#3024)
- NonNegativeFloat (#3015)
- NonPositiveInt (#3026)
- PositiveInt (#2929)
- NonNegativeInt (#3020)
- NegativeInt (#2940)
- NonNegativeInt (#3020)
- NonEmptyString (#2940)
- Rgb (#3213)
- Port (#3211)
- Ipv6 (#3206)
- ISBN (#3201)
- Regex (#3184, #3130)
- MacAddress (#3183)
- Hsla (#3141)
- Ipv4 (#3097)
- Hsl (#3082)
- HexColor (#3077)
- UnsignedInt (#3052)
- PostalCode (#3046)
- UtcOffset (#3362)
- PhoneNumber (#2995)
- EmailAddress (#2989)
- NegativeFloat (#2996)
- NonPositiveFloat (#3024)
- NonNegativeFloat (#3015)
- NonPositiveInt (#3026)
- PositiveInt (#2929)
- NonNegativeInt (#3020)
- NegativeInt (#2940)
- NonNegativeInt (#3020)
- NonEmptyString (#2940)
- Rgb (#3213)
- Port (#3211)
- Ipv6 (#3206)
- ISBN (#3201)
- Regex (#3184, #3130)
- MacAddress (#3183)
- Hsla (#3141)
- Ipv4 (#3097)
- Hsl (#3082)
- HexColor (#3077)
- UnsignedInt (#3052)
- PostalCode (#3046)
- UtcOffset (#3362)

- Added support for GraphQL multipart request specification to Hot Chocolate (#2936).
- Added Strawberry Shake GraphQL client.
Expand Down Expand Up @@ -195,7 +195,7 @@ Return argument value as field definition runtimeType if requested as object typ
### Fixed

- Fixed selection optimizer were not resolved correctly. (#2889)
- Fixed projection of edge type (#2888)
- Fixed projection of edge type (#2888)

## [11.0.8]

Expand All @@ -217,7 +217,6 @@ Return argument value as field definition runtimeType if requested as object typ
- Fixed projections with multiple interceptors. (#2836)
- Fixed string literals in places of enum values have to raise a query errors. (#2846)
- Fixed issues with Apollo active persisted queries flow. (#2864)


## [11.0.7]

Expand Down Expand Up @@ -388,8 +387,8 @@ Return argument value as field definition runtimeType if requested as object typ
- Unsealed AuthorizeAttribute. [#1993](https://github.com/ChilliCream/hotchocolate/pull/1993)
- Expose character-set in content-type.
- Use invariant culture when parsing numbers in AnyType [#2134](https://github.com/ChilliCream/hotchocolate/pull/2134)
- Changed behavior of `SubscribeAttribute` to align better with the behaviour of version 11.
- Changed ID serializer to align better with the behaviour of version 11.
- Changed behavior of `SubscribeAttribute` to align better with the behavior of version 11.
- Changed ID serializer to align better with the behavior of version 11.

### Fixed

Expand Down Expand Up @@ -448,7 +447,6 @@ Return argument value as field definition runtimeType if requested as object typ

- Fixed default hash provider dependency injection configuration [#1363](https://github.com/ChilliCream/hotchocolate/pull/1363)


## [10.3.3]

### Fixed
Expand Down Expand Up @@ -738,8 +736,8 @@ Return argument value as field definition runtimeType if requested as object typ
### Fixed

- Introspection default values are now serialized correctly.
- Added missing validation rule: https://facebook.github.io/graphql/June2018/#sec-All-Variable-Uses-Defined
- The non-null value violation is now propagated correctly. https://facebook.github.io/graphql/June2018/#sec-Errors
- Added missing validation rule: <https://facebook.github.io/graphql/June2018/#sec-All-Variable-Uses-Defined>
- The non-null value violation is now propagated correctly. <https://facebook.github.io/graphql/June2018/#sec-Errors>

## [0.7.0] - 2019-02-03

Expand Down
11 changes: 10 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Core contributors will review your pull request and provide feedback.

## How to launch and build the solution

We use [Nuke](https://nuke.build/) for build automation.
We use [Nuke](https://nuke.build/) for build automation.

To work on Hot Chocolate, you will need .NET 7, Node 14, and Yarn 1.x.

Expand All @@ -73,6 +73,15 @@ The documentation is located in the `website` directory and can be started with

There are other available commands too. As set up in the [.build](./.build/) directory.

## How to Check the docs

We use [Markdownlint](https://github.com/DavidAnson/markdownlint) to check markdown formatting and [cSpell](https://cspell.org) for spelling. We have GitHub actions to check these for PRs, but if you'd like to check locally, you can:

- Install cSpell: `npm install -g cspell`
- Install the markdownlint CLI: `npm install -g markdownlint-cli`.
- For spellcheck, run `cspell --config ./cSpell.json "website/src/**/*.md" --no-progress`
- For markdown linting, run `markdownlint "./website/src/**/*.md" --disable MD013`

## Code of conduct

See [CODE-OF-CONDUCT.md](./CODE-OF-CONDUCT.md)
70 changes: 70 additions & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"version": "0.2",
"language": "en",
"words": [
"Blazor",
"BSON",
"Cakepop",
"chillicream",
"Contoso",
"customizability",
"dataloaders",
"discoverability",
"entityframework",
"evolvability",
"fastify",
"fetchable",
"FIPS",
"Hasura",
"hotchocolate",
"jetbrains",
"JWTs",
"Linq",
"microservices",
"middlewares",
"NodaTime",
"OWIN",
"pageable",
"protobuf",
"roadmap",
"runbooks",
"struct",
"Swashbuckle",
"traversion",
"Websockets"
],
"ignoreWords": [
"Specwise",
"strawberryshake",
"refactorings",
"mercurius",
"Giroux",
"graphyne",
"greendonut",
"Andi",
"aspnetcore",
"bananacakepop",
"Marek",
"Kellner",
"Kydne",
"GraphiQL",
"Tengler",
"Staib",
"shoooe",
"Senn",
"Snapshooter",
"relayjs",
"Rgba",
"Postgraphile",
"Normen",
],
"ignoreRegExpList": [
"\\((.*)\\)", // Markdown links
"```[a-z]*\n[\\s\\S]*?\n```", // Markdown code blocks. h/t https://coderwall.com/p/r6b4xg/regex-to-match-github-s-markdown-code-blocks,
"\\`([^\\`].*?)\\`", // inline code blocks. h/t https://stackoverflow.com/questions/41274241/how-to-capture-inline-markdown-code-but-not-a-markdown-code-fence-with-regex
"\\<a(.*)\\>", // link contents
"-- snippet:(.*)", // snippet references
"\\<\\[sample:(.*)", // another kind of snippet reference
"/^\\s*```[\\s\\S]*?^\\s*```/gm" // ignoring multi-line code blocks
]
}
27 changes: 12 additions & 15 deletions website/src/blog/2018-07-31-hot-chocolate-0.4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Person {

The above schema allows to fetch a person by its internal identifier and each person has a list of friends that is represented by a list of persons.

Since GraphQL requests are not fixed requests like REST requests, the developer really defines what data he/she wants. This avoids overfetching data that you do not need and also saves you unecessary roundtrips to the GraphQL backend.
Since GraphQL requests are not fixed requests like REST requests, the developer really defines what data he/she wants. This avoids over-fetching data that you do not need and also saves you unnecessary round-trips to the GraphQL backend.

So, a query against the above schema could look like the following:

Expand All @@ -54,7 +54,7 @@ So, a query against the above schema could look like the following:
}
```

The above request fetches two persons in one go without the need to call the backend twice. The problem for the GraphQL backend is that field resolvers are atomic and do not have any knoledge about the query as a whole. So, a field resolver does not know that it will be called multiple times in parallel to fetch similar or equal data from the same data source.
The above request fetches two persons in one go without the need to call the backend twice. The problem for the GraphQL backend is that field resolvers are atomic and do not have any knowledge about the query as a whole. So, a field resolver does not know that it will be called multiple times in parallel to fetch similar or equal data from the same data source.

This basically represents the first case where _DataLoaders_ help us by batching requests against our database or backend service. Currently, we allow _DataLoaders_ per request and globally.

Expand All @@ -69,11 +69,11 @@ public async Task<Person> GetPerson(string id, [Service]IPersonRepository reposi

The above example would result in two calls to the person repository that would than fetch the persons one by one from our data source.

If you think that through you can see that each GraphQL request would cause multiple requests to our data source resulting in slugish performance and uneccessary roundtrips to our data source.
If you think that through you can see that each GraphQL request would cause multiple requests to our data source resulting in sluggish performance and unnecessary round-trips to our data source.

This, means that we reduced the roundtrips from our client to our server with GraphQL but multiplied the roundtrips between the data sources and the service layer.
This, means that we reduced the round-trips from our client to our server with GraphQL but multiplied the round-trips between the data sources and the service layer.

With _DataLoaders_ we can now centralise our person fetching and reduce the number of round trips to our data source.
With _DataLoaders_ we can now centralize our person fetching and reduce the number of round trips to our data source.

First, we have to create a _DataLoader_ that now acts as intermediary between a field resolver and the data source.

Expand Down Expand Up @@ -108,7 +108,7 @@ public Task<Person> GetPerson(string id, [DataLoader]PersonDataLoader personLoad
}
```

Next, we have to register our _DataLoader_ with the schema. By default, _DataLoaders_ are registerd as per-request meaning that the execution engine will create one instance of each _DataLoader_ per-request **if** a field resolver has requested a _DataLoader_. This ensures that, _DataLoaders_ that are not beeing requested are not instantiated unnecessarily.
Next, we have to register our _DataLoader_ with the schema. By default, _DataLoaders_ are registered as per-request meaning that the execution engine will create one instance of each _DataLoader_ per-request **if** a field resolver has requested a _DataLoader_. This ensures that, _DataLoaders_ that are not being requested are not instantiated unnecessarily.

```csharp
Schema.Create(c =>
Expand Down Expand Up @@ -174,13 +174,13 @@ This is the second problem class the _DataLoader_ utility helps us with since th

For more information about our _DataLoader_ implementation head over to our _DataLoader_ [GitHub repository](https://github.com/ChilliCream/greendonut).

As a side note, you are not bound to our _DataLoader_ implementation. If you want to create your own implementation of _DataLoaders_ or if you already have a _DataLoader_ implementation then you can hook this up to our execution engine as well. I will explain this in the _DataLoader_ documentation once I have finalised it.
As a side note, you are not bound to our _DataLoader_ implementation. If you want to create your own implementation of _DataLoaders_ or if you already have a _DataLoader_ implementation then you can hook this up to our execution engine as well. I will explain this in the _DataLoader_ documentation once I have finalized it.

## Custom Context Objects

Custom context objects are basically custom .net objects that you can declare with the GraphQL engine and access throughout your request execution. Custom context objects can use dependency injection and have the same scoping as the _DataLoaders_.

For example you could declare a class that handles authorithation for your service like an IPrincipal and access this in each resolver.
For example you could declare a class that handles authorization for your service like an IPrincipal and access this in each resolver.

```csharp
public Task<ResolverResult<Person>> GetPerson(string id, [State]MyPrincipal principal)
Expand All @@ -194,9 +194,9 @@ public Task<ResolverResult<Person>> GetPerson(string id, [State]MyPrincipal prin
}
```

Moreover, you can use this custom context to store states in or caches during execution time. This will become especially usefull with our next version when we allow the writing of custom schema directives and field resolver middlewares.
Moreover, you can use this custom context to store states in or caches during execution time. This will become especially useful with our next version when we allow the writing of custom schema directives and field resolver middlewares.

Custom context objects are registerd like _DataLoaders_:
Custom context objects are registered like _DataLoaders_:

```csharp
Schema.Create(c =>
Expand All @@ -207,7 +207,7 @@ Schema.Create(c =>
});
```

Like with _DataLoaders_ we have muliple `RegisterCustomContext` overloads that allow for more control over how the object is created.
Like with _DataLoaders_ we have multiple `RegisterCustomContext` overloads that allow for more control over how the object is created.

## Query Validation

Expand All @@ -226,7 +226,7 @@ We plan for full compliance with the June 2018 spec version with version 0.6.0.

## Dependency Injection

We reworked out dependency injection approach and have now integreaded the request services during request execution. Meaning you are now able to access HttpContext directly as a field resolver argument.
We reworked out dependency injection approach and have now integrated the request services during request execution. Meaning you are now able to access HttpContext directly as a field resolver argument.

This was already possible with the old version through the accessor as a constructor injection.

Expand All @@ -250,6 +250,3 @@ It is important to know that http related services are only available if the exe
From a design standpoint you should avoid accessing this directly and think about a custom context object which would provide some abstraction.

I will write some more on dependency injection sometime later this week.

[hot chocolate]: https://hotchocolate.io
[hot chocolate source code]: https://github.com/ChilliCream/hotchocolate
4 changes: 1 addition & 3 deletions website/src/blog/2018-09-02-hot-chocolate-0.4.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ public class PersonType : ObjectType<Person>

With version 0.5 we will focus on subscriptions and custom directives.

Custom will allow for writing field resolver middlewares that alter or replace the default execution behaviour.
Custom will allow for writing field resolver middlewares that alter or replace the default execution behavior.

Subscriptions is one of our last spec gaps.

[hot chocolate]: https://hotchocolate.io
[hot chocolate source code]: https://github.com/ChilliCream/hotchocolate
Loading

0 comments on commit 6869a40

Please sign in to comment.