diff --git a/website/src/docs/greendonut/v10/api.md b/website/src/docs/greendonut/v10/api.md
index 41aec213d60..acbceb892e9 100644
--- a/website/src/docs/greendonut/v10/api.md
+++ b/website/src/docs/greendonut/v10/api.md
@@ -1,5 +1,5 @@
---
-title: IDataLoader
+title: IDataLoader
---
**Description:** Represents a minimal set of _DataLoader_ functionality.
@@ -78,7 +78,7 @@ values and enqueues requests which were not cached for batching if enabled.
---
-## LoadAsync(IReadOnlyCollection keys)
+## LoadAsync(IReadOnlyCollection keys)
**Description:** Loads multiple values by keys. This call may return cached
values and enqueues requests which were not cached for batching if enabled.
@@ -103,7 +103,7 @@ values and enqueues requests which were not cached for batching if enabled.
---
-## Set(TKey key, Task value)
+## Set(TKey key, Task value)
**Description:** Adds a new entry to the cache if not already exists.
diff --git a/website/src/docs/hotchocolate/api-reference/coding-approaches.md b/website/src/docs/hotchocolate/api-reference/coding-approaches.md
index 6d1af590367..0f272921eb7 100644
--- a/website/src/docs/hotchocolate/api-reference/coding-approaches.md
+++ b/website/src/docs/hotchocolate/api-reference/coding-approaches.md
@@ -11,5 +11,3 @@ In case you might need help, check out our [Slack channel](https://join.slack.co
Sorry for any inconvenience, and thank you for being patient!
The ChilliCream Team
-
-
diff --git a/website/src/docs/hotchocolate/api-reference/extending-filtering.md b/website/src/docs/hotchocolate/api-reference/extending-filtering.md
index 7bb50b148ba..90c5a0c7835 100644
--- a/website/src/docs/hotchocolate/api-reference/extending-filtering.md
+++ b/website/src/docs/hotchocolate/api-reference/extending-filtering.md
@@ -19,34 +19,22 @@ Usually, it makes sense to divide the structure into two parts. The _field_ and
The query below returns all movies where the franchise is equal to "Star Wars". The _field_ `franchise` where the filter
is applied to and the _operation_ equals (`eq`) that should operate on this field.
-```
+```graphql
{
- movies(
- where: {
- franchise: {
- eq: "Star Wars"
- }
- }) {
- name
- }
+ movies(where: { franchise: { eq: "Star Wars" } }) {
+ name
+ }
}
```
Fields can also form paths. In the query below there are two _fields_ `genre` and `totalMovieCount` and one operation equals
`eq`
-```
+```graphql
{
- movies(
- where: {
- genre: {
- totalMovieCount: {
- eq: 100
- }
- }
- }) {
- name
- }
+ movies(where: { genre: { totalMovieCount: { eq: 100 } } }) {
+ name
+ }
}
```
@@ -296,8 +284,7 @@ A little simplified this is what happens during visitation:
```graphql
{
users(
- where: # Create SCOPE 1 with parameter x of type User
- # instance[0] = x
+ where: # instance[0] = x # Create SCOPE 1 with parameter x of type User
# level[0] = []
{
# Push property User.Company onto the scope
diff --git a/website/src/docs/hotchocolate/api-reference/filtering.md b/website/src/docs/hotchocolate/api-reference/filtering.md
index fecc4570d5b..8f84f3aaa8d 100644
--- a/website/src/docs/hotchocolate/api-reference/filtering.md
+++ b/website/src/docs/hotchocolate/api-reference/filtering.md
@@ -46,7 +46,7 @@ Getting started with filters is very easy, especially if you do not want to expl
Hot Chocolate will infer the filters directly from your .Net Model and then use a Middleware to apply filters to `IQueryable` or `IEnumerable` on execution.
-> ⚠️ **Note:** If you use more than middleware, keep in mind that **ORDER MATTERS** _Why order matters_ <>
+> ⚠️ **Note:** If you use more than middleware, keep in mind that **ORDER MATTERS**.
> ⚠️ **Note:** Be sure to install the `HotChocolate.Types.Filters` NuGet package.
@@ -711,7 +711,7 @@ public class UserFilterType : FilterInputType
# Naming Conventions
-\_Hot Chocolate already provides two naming schemes for filters. If you would like to define your own naming scheme or extend existing ones have a look at the documentation of <>
+\_Hot Chocolate already provides two naming schemes for filters. If you would like to define your own naming scheme or extend existing ones have a look at the documentation of TODO:Link-Filtering
## Snake Case
@@ -942,7 +942,7 @@ input UserFilter {
To add or customize a filter you must use `Filter(x => x.Foo)` for scalars `List(x => x.Bar)` for lists and `Object(x => x.Baz)` for nested objects.
These methods will return fluent interfaces to configure the filter for the selected field.
-A field has different filter operations that you can configure. You will find more about filter types and filter operations here <>
+A field has different filter operations that you can configure. You will find more about filter types and filter operations here TODO:Link
When fields are bound implicitly, meaning filters are added for all properties, you may want to hide a few fields. You can do this with `Ignore(x => Bar)`.
Operations on fields can again be bound implicitly or explicitly. By default, Hot Chocolate generates operations for all fields of the type.
If you do want to specify the operations by yourself you can change this behavior with `BindFilters`, `BindFiltersExplicitly` or `BindFiltersImplicitly`.
@@ -1030,14 +1030,12 @@ SchemaBuilder.New().AddConvention(new FilterConvention(x => /* Config */));
In this section, we will take a look at the basic features of the filter convention.
The documentation will reference often to `descriptor`. Imagine this `descriptor` as the parameter of the Configure method of the filter convention in the following context:
-```csharp
+```csharp {5}
public class CustomConvention
: FilterConvention
{
protected override void Configure(
- /**highlight-start**/
IFilterConventionDescriptor descriptor
- /**highlight-end**/
) { }
}
@@ -1202,7 +1200,7 @@ You can drill up with `And()`.
### Configuration of the type system
-In this section, we will focus on the generation of the schema. If you are interested in changing how filters translate to the database, you have to look here <>
+In this section, we will focus on the generation of the schema. If you are interested in changing how filters translate to the database, you have to look here TODO:Link
#### Configure Filter Operations
@@ -1265,7 +1263,7 @@ public delegate NameString CreateFieldName(
**Configuration**
-```csharp{1, 6}
+```csharp {1, 6}
// (A)
// specifies that all not equals operations should be extended with _nada
descriptor
@@ -1282,7 +1280,7 @@ public delegate NameString CreateFieldName(
**result**
-```graphql{8,18}
+```graphql {8,18}
input UserFilter {
loggingCount: Int
loggingCount_gt: Int
@@ -1333,7 +1331,7 @@ You can either set the description for all operations of this kind or only for a
**result**
-```graphql{2-4,11-14, 20-22,27-29}
+```graphql {2-4,11-14, 20-22,27-29}
input UserFilter {
"""
has to be equal
@@ -1396,7 +1394,7 @@ There are multiple ways to ignore an operation:
**result**
-```graphql{2,4, 8,14,18}
+```graphql {2,4, 8,14,18}
input UserFilter {
↵
loggingCount_gt: Int
@@ -1969,7 +1967,7 @@ This delegate might seem intimidating first, but it is not bad as it looks. If t
Operations handlers can be configured like the following:
-```csharp{10,13}
+```csharp {10,13}
public class CustomConvention : FilterConvention
{
protected override void Configure(
diff --git a/website/src/docs/hotchocolate/api-reference/index.md b/website/src/docs/hotchocolate/api-reference/index.md
index a8d7018834a..b666f99adb9 100644
--- a/website/src/docs/hotchocolate/api-reference/index.md
+++ b/website/src/docs/hotchocolate/api-reference/index.md
@@ -11,5 +11,3 @@ In case you might need help, check out our [Slack channel](https://join.slack.co
Sorry for any inconvenience, and thank you for being patient!
The ChilliCream Team
-
-
diff --git a/website/src/docs/hotchocolate/api-reference/migrate-from-10-to-11.md b/website/src/docs/hotchocolate/api-reference/migrate-from-10-to-11.md
index 70fe926b3f2..8c490ef4f92 100644
--- a/website/src/docs/hotchocolate/api-reference/migrate-from-10-to-11.md
+++ b/website/src/docs/hotchocolate/api-reference/migrate-from-10-to-11.md
@@ -666,6 +666,7 @@ downstream schemas.
```
## Batch responses
+
In v10, responses to batched operations were returned as a JsonArray. In v11 the default is to return MultiPartChunked responses. To switch back to JsonArray, configure the HttpResult serializer as follows:
```csharp
diff --git a/website/src/docs/hotchocolate/api-reference/object-type.md b/website/src/docs/hotchocolate/api-reference/object-type.md
index 1d79c57fa7b..693d51b6c2b 100644
--- a/website/src/docs/hotchocolate/api-reference/object-type.md
+++ b/website/src/docs/hotchocolate/api-reference/object-type.md
@@ -2,6 +2,8 @@
title: Object Type
---
+import { ExampleTabs } from "../../../components/mdx/example-tabs"
+
The object type is the most important output type in GraphQL and represents the data we can fetch from our GraphQL server. The GraphQL SDL representation of an object looks like the following:
```sdl
@@ -17,7 +19,8 @@ represent raw data that is passed into a field.
> **Note:** Every single code example will be shown in three different approaches, annotation-based (previously known as pure code-first), code-first, and schema-first. However, they will always result in the same outcome on a GraphQL schema perspective and internally in Hot Chocolate. All three approaches have their pros and cons and can be combined when needed with each other. If you would like to learn more about the three approaches in Hot Chocolate, click on [Coding Approaches](/docs/hotchocolate/api-reference/coding-approaches).
-**Annotation-based approach**
+
+
```csharp
// Query.cs
@@ -49,7 +52,8 @@ public class Startup
}
```
-**Code-first approach**
+
+
```csharp
// Query.cs
@@ -108,7 +112,8 @@ public class Startup
}
```
-**Schema-first approach**
+
+
```csharp
// Query.cs
@@ -142,6 +147,9 @@ public class Startup
}
```
+
+
+
# Extension
The GraphQL SDL supports extending object types, this means that we can add fields to an existing object type without changing the code of our initial type definition.
diff --git a/website/src/docs/hotchocolate/api-reference/visitors.md b/website/src/docs/hotchocolate/api-reference/visitors.md
index 8eec9ee5bdd..84501df8032 100644
--- a/website/src/docs/hotchocolate/api-reference/visitors.md
+++ b/website/src/docs/hotchocolate/api-reference/visitors.md
@@ -82,7 +82,7 @@ If `Continue` is returned from the `Enter` or `Leave` method visitation on the c
In the following example `Continue` is returned from the onEnter method. The visitor calls `VisitChildren` and continues to by _entering_ the selection set.
-```graphql{4}
+```graphql {4}
query {
foo {
bar
@@ -100,7 +100,7 @@ If `Skip` is returned from the `Enter` or `Leave` method, further visitation on
In the following example `Skip` is returned from the onEnter method. The visitor skips the field _baz_. It continues visitation by _entering_ the field _qux_.
-```graphql{4}
+```graphql {4}
query {
foo {
bar
@@ -118,7 +118,7 @@ If `SkipAndLeave` is returned from the Enter method, further visitation on this
In the following example `SkipAndLeave` is returned from the onEnter method. The visitor skips the field _baz_. Before it continues visitation with the field _qux_ it calls the _leaves_ the field _baz_ by calling `Leave`
-```graphql{4}
+```graphql {4}
query {
foo {
bar
@@ -136,7 +136,7 @@ If `Break` is returned from the `Enter` or `Leave` method, further visitation on
In the following example `Break` is returned from the onEnter method. The visitor immediately starts walking back up. The visitor calls the `Leave` on `foo` instead of visiting the selections set of _baz_ it skips _baz_ and _qux_.
-```graphql{4}
+```graphql {4}
query {
foo {
bar
diff --git a/website/src/docs/hotchocolate/defining-a-schema/index.md b/website/src/docs/hotchocolate/defining-a-schema/index.md
index 9b55ee17508..bbc0f573e91 100644
--- a/website/src/docs/hotchocolate/defining-a-schema/index.md
+++ b/website/src/docs/hotchocolate/defining-a-schema/index.md
@@ -2,13 +2,15 @@
title: "Schema basics"
---
+import { ExampleTabs } from "../../../components/mdx/example-tabs"
+
The schema in GraphQL represents the type system and exposes your business model in a strong and rich way. The schema fully describes the shape of your data and how you can interact with it.
# Object Type
The most important type in a GraphQL schema is the object type which lets you consume data. Every object type has to have at least one field which holds the data of an object. Fields can return simple scalars like String, Int, or again object types.
-```SDL
+```sdl
type Book {
title: String
author: String
@@ -19,7 +21,7 @@ type Book {
In GraphQL, we have three root types from which only the Query type has to be defined. Root types provide the entry points that let you fetch data, mutate data, or subscribe to events. Root types themself are object types.
-```SDL
+```sdl
schema {
query: Query
}
@@ -38,7 +40,8 @@ In Hot Chocolate, there are three ways to define an object type.
> **Note:** Every single code example will be shown in three different approaches, annotation-based (previously known as pure code-first), code-first, and schema-first. However, they will always result in the same outcome on a GraphQL schema perspective and internally in Hot Chocolate. All three approaches have their pros and cons and can be combined when needed with each other. If you would like to learn more about the three approaches in Hot Chocolate, click on [Coding Approaches](/docs/hotchocolate/api-reference/coding-approaches).
-**Annotation-based approach**
+
+
```csharp
// Query.cs
@@ -70,7 +73,8 @@ public class Startup
}
```
-**Code-first approach**
+
+
```csharp
// Query.cs
@@ -129,7 +133,8 @@ public class Startup
}
```
-**Schema-first approach**
+
+
```csharp
// Query.cs
@@ -163,6 +168,9 @@ public class Startup
}
```
+
+
+
## Fields
Fields of object types can be compared to methods in C# and allow us to pass in arguments.
@@ -186,7 +194,8 @@ type Book {
}
```
-**Annotation-based approach**
+
+
```csharp
// Query.cs
@@ -221,7 +230,8 @@ public class Startup
}
```
-**Code-first approach**
+
+
```csharp
// Query.cs
@@ -283,7 +293,8 @@ public class Startup
}
```
-**Schema-first approach**
+
+
```csharp
// Query.cs
@@ -320,6 +331,9 @@ public class Startup
}
```
+
+
+
> Further reading:
>
> - [Object Types](/docs/hotchocolate/api-reference/object-type).
@@ -338,7 +352,8 @@ input BookInput {
If we wanted for instance to create a new book with a mutation we could do that like the following.
-**Annotation-based approach**
+
+
```csharp
// Query.cs
@@ -379,7 +394,8 @@ public class Startup
}
```
-**Code-first approach**
+
+
```csharp
// Query.cs
@@ -441,7 +457,8 @@ public class Startup
}
```
-**Schema-first approach**
+
+
```csharp
// Query.cs
@@ -478,6 +495,9 @@ public class Startup
}
```
+
+
+
# Lists
# Nullability
diff --git a/website/src/docs/hotchocolate/defining-a-schema/scalars.md b/website/src/docs/hotchocolate/defining-a-schema/scalars.md
index b7a1fc8000e..1d2d882d9aa 100644
--- a/website/src/docs/hotchocolate/defining-a-schema/scalars.md
+++ b/website/src/docs/hotchocolate/defining-a-schema/scalars.md
@@ -2,15 +2,15 @@
title: "Scalars"
---
-A GraphQL schema should be built as expressive as possible.
-Just from looking at the schema, a developer should know how to use the API.
+A GraphQL schema should be built as expressive as possible.
+Just from looking at the schema, a developer should know how to use the API.
In GraphQL you are not limited to only describing the structure of a type, you can even describe value types.
Scalar types represent types that can hold data of a specific kind.
Scalars are leaf types, meaning you cannot use e.g. `{ fieldname }` to further drill down into the type.
-A scalar must only know how to serialize and deserialize the value of the field.
-GraphQL gives you the freedom to define custom scalar types.
-This makes them the perfect tool for expressive value types.
+A scalar must only know how to serialize and deserialize the value of the field.
+GraphQL gives you the freedom to define custom scalar types.
+This makes them the perfect tool for expressive value types.
You could create a scalar for `CreditCardNumber` or `NonEmptyString`.
The GraphQL specification defines the following scalars
@@ -39,9 +39,10 @@ In addition to the scalars defined by the specification, HotChocolate also suppo
| `Any` | This type can be anything, string, int, list or object etc. |
# Using Scalars
+
HotChocolate will automatically detect which scalars are in use and will only expose those in the introspection. This keeps the schema definition small, simple and clean.
-The schema discovers .NET types and binds the matching scalar to the type.
+The schema discovers .NET types and binds the matching scalar to the type.
HotChocolate, for example, automatically binds the `StringType` on a member of the type `System.String`.
You can override these mappings by explicitly specifying type bindings on the request executor builder.
@@ -71,7 +72,7 @@ public void ConfigureServices(IServiceCollection services)
# Any Type
-The `Any` scalar is a special type that can be compared to `object` in C#.
+The `Any` scalar is a special type that can be compared to `object` in C#.
`Any` allows us to specify any literal or return any output type.
Consider the following type:
@@ -131,13 +132,14 @@ If you want to access an object dynamically without serializing it to a strongly
Lists can be accessed generically by getting them as `IReadOnlyList