Skip to content

Commit 1de46c1

Browse files
authoredApr 22, 2021
Document subscriptions (#3525)
1 parent 0995368 commit 1de46c1

File tree

6 files changed

+335
-108
lines changed

6 files changed

+335
-108
lines changed
 

‎website/src/docs/hotchocolate/api-reference/extending-filtering.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ This convention is also configurable with a fluent interface, so in most cases y
7272
## Descriptor
7373

7474
Most of the capabilities of the descriptor are already documented under `Fetching Data -> Filtering`.
75-
If you have not done this already, it is now the right time to head over to [Filtering](https://chillicream.com/docs/hotchocolate/fetching-data/filtering) and read the parts about the `FilterConventions`
75+
If you have not done this already, it is now the right time to head over to [Filtering](/docs/hotchocolate/fetching-data/filtering) and read the parts about the `FilterConventions`
7676

7777
There are two things on this descriptor that are not documented in `Fetching Data`:
7878

@@ -284,8 +284,7 @@ A little simplified this is what happens during visitation:
284284
```graphql
285285
{
286286
users(
287-
where: # instance[0] = x # Create SCOPE 1 with parameter x of type User
288-
# level[0] = []
287+
where: # level[0] = [] # instance[0] = x # Create SCOPE 1 with parameter x of type User
289288
{
290289
# Push property User.Company onto the scope
291290
# instance[1] = x.Company

‎website/src/docs/hotchocolate/api-reference/filtering.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ private static bool TryCreateStringFilter(
14621462
IFilterConvention filterConventions,
14631463
[NotNullWhen(true)] out FilterFieldDefintion? definition)
14641464
{
1465-
if (type == typeof())
1465+
if (type == typeof(string))
14661466
{
14671467
var field = new StringFilterFieldDescriptor(context, property, filterConventions);
14681468
definition = field.CreateDefinition();
@@ -1646,14 +1646,14 @@ public static class DateTimeFilterConventionExtensions
16461646
`DateTime` is a new filter. Hot Chocolate is only aware of its existence because of the delegate passed to `AddImplicitFilter`
16471647

16481648
```csharp
1649-
private static bool TryCreateDateTimeFiler(
1649+
private static bool TryCreateDateTimeFilter(
16501650
IDescriptorContext context,
16511651
Type type,
16521652
PropertyInfo property,
16531653
IFilterConvention filterConventions,
16541654
[NotNullWhen(true)] out FilterFieldDefintion? definition)
16551655
{
1656-
if (type == typeof())
1656+
if (type == typeof(DateTime))
16571657
{
16581658
var field = new DateTimeFilterFieldDescriptor(
16591659
context, property, filterConventions);

‎website/src/docs/hotchocolate/defining-a-schema/operations.md

+314-87
Large diffs are not rendered by default.

‎website/src/docs/hotchocolate/get-started.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ title: "Get started with Hot Chocolate"
44

55
> We are still working on the documentation for Hot Chocolate 11.1 so help us by finding typos, missing things or write some additional docs with us.
66
7-
In this tutorial, we will walk you through the basics of creating a GraphQL server with Hot Chocolate. If you want to dig deeper into Hot Chocolate, we have our GraphQL workshop, which touches on topics like schema design, DataLoader, and many more things.
7+
In this tutorial, we will walk you through the basics of creating a GraphQL server with Hot Chocolate. If you want to dig deeper into Hot Chocolate, we have our [GraphQL workshop](https://github.com/ChilliCream/graphql-workshop), which touches on topics like schema design, DataLoader, and many more things.
88

9-
In this tutorial, we will teach you:
9+
In this tutorial, we will teach you how to:
1010

11-
- To set up a GraphQL Server.
12-
- To define a GraphQL schema.
13-
- To query your GraphQL server.
11+
- Set up a GraphQL server.
12+
- Define a GraphQL schema.
13+
- Query your GraphQL server.
1414

1515
# Step 1: Create a GraphQL server project
1616

@@ -20,14 +20,12 @@ Open your preferred terminal and select a directory where you want to add the co
2020

2121
```bash
2222
dotnet new web -n Demo
23-
dotnet new sln -n Demo
24-
dotnet sln add ./Demo
2523
```
2624

2725
2. Add the `HotChocolate.AspNetCore` package.
2826

2927
```bash
30-
dotnet add ./Demo package HotChocolate.AspNetCore --version 11.1.0
28+
dotnet add ./Demo package HotChocolate.AspNetCore
3129
```
3230

3331
# Step 2: Create a GraphQL schema
@@ -60,7 +58,7 @@ namespace Demo
6058
}
6159
```
6260

63-
We have a nice and simple model with these two classes that we can use to build our GraphQL schema. We now need to define a query root type. The query root type exposes all the possible queries that a user can drill into. A query root type can be defined as our models just with C#.
61+
With these two classes we have a nice and simple model that we can use to build our GraphQL schema. We now need to define a query root type. The query root type exposes all the possible queries that a user can drill into. A query root type can be defined in the same way we defined our models.
6462

6563
3. Add a new class `Query`.
6664

@@ -109,6 +107,8 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
109107
}
110108
```
111109

110+
> Note: We also have a template, which includes the configurations we have just made. Just install the template using `dotnet new -i HotChocolate.Templates.Server` and now you can use `dotnet new graphql` to bootstrap your future GraphQL servers!
111+
112112
# Step 3: Execute a GraphQL query
113113

114114
Now that your server is finished let us try it out by executing a simple GraphQL query.
@@ -119,11 +119,11 @@ Now that your server is finished let us try it out by executing a simple GraphQL
119119
dotnet run --project ./Demo
120120
```
121121

122-
2. Open Chrome, Edge or Firefox and head over to `http://localhost:5000/graphql` to open the built-in GraphQL IDE Banana Cake Pop.
122+
2. Open your browser and head over to `http://localhost:5000/graphql` to open our built-in GraphQL IDE [Banana Cake Pop](/docs/bananacakepop/).
123123

124124
![GraphQL IDE](../../images/get-started-bcp.png)
125125

126-
3. Next, click on the `Book` icon on the left-hand navigation bar to explore the server GraphQL schema. If this is the first time you are running the demo, you will need to enter `http://localhost:5000/graphql` as the schema endpoint URI. In the schema explorer, we can see that we have one query root field exposed. By clicking on the field, we can drill into the schema structure.
126+
3. Next, click on the `Book` icon in the left-hand navigation bar to explore the server's GraphQL schema. If this is the first time you are running the demo, you will need to enter `http://localhost:5000/graphql` as the schema endpoint URI. In the schema explorer, we can see that we have one query root field exposed. By clicking on the field, we can drill into the schema structure.
127127

128128
![GraphQL IDE Schema Explorer](../../images/get-started-bcp-schema-explorer.png)
129129

‎website/src/pages/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const IndexPage: FunctionComponent = () => {
172172
our startup guide and see how simple it is to create your first
173173
API.
174174
</p>
175-
<Link to="/docs/hotchocolate/v10/">Learn more</Link>
175+
<Link to="/docs/hotchocolate">Learn more</Link>
176176
</ContentContainer>
177177
</SectionRow>
178178
</Section>

‎website/src/pages/platform.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ const PlatformPage: FunctionComponent = () => {
3939
<ContentContainer>
4040
<SectionTitle>Hot Chocolate</SectionTitle>
4141
<p>
42-
Hot Chocolate is the GraphQL server and provides core libraries
42+
Hot Chocolate is our GraphQL server and provides core libraries
4343
for Strawberry Shake, our GraphQL client, and our GraphQL tools.
4444
No wonder why Hot Chocolate is the ChilliCream's platform core.
4545
</p>
46-
<Link to="/docs/hotchocolate/v10/">Learn more</Link>
46+
<Link to="/docs/hotchocolate">Learn more</Link>
4747
</ContentContainer>
4848
</SectionRow>
4949
</Section>
@@ -88,7 +88,8 @@ const PlatformPage: FunctionComponent = () => {
8888
<p>
8989
Keep track of all clients that depend on your GraphQL endpoints.
9090
</p>
91-
<Link to="/docs/marshmallowpie">Learn more</Link>
91+
{/* comment in again, once there is documentation */}
92+
{/* <Link to="/docs/marshmallowpie">Learn more</Link> */}
9293
</ContentContainer>
9394
</SectionRow>
9495
</Section>

0 commit comments

Comments
 (0)
Please sign in to comment.