Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown linting: low hanging fruit #6843

Merged
merged 17 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/linters/.markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,13 @@
# Rules by id #
###############
MD001: false
MD009: false
MD012: false
MD013: false
MD018: false
MD022: false
MD024: false
MD025: false
MD026: false
MD028: false
MD029: false
MD031: false
MD032: false
MD033: false
MD034: false
MD036: false
MD037: false
MD040: false
Expand Down
9 changes: 1 addition & 8 deletions .markdownlintrc
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
{
"MD001": false,
"MD009": false,
"MD012": false,
"MD013": false,
"MD018": false,
"MD022": false,
"MD024": false,
"MD025": false,
"MD026": false,
"MD028": false,
"MD029": false,
"MD031": false,
"MD032": false,
"MD033": false,
"MD034": false,
"MD036": false,
"MD037": false,
"MD040": false,
"MD041": false,
"MD045": false,
"MD053": false
}
}
2 changes: 1 addition & 1 deletion website/src/blog/2013-09-12-jquery-steps-form-wizard.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authorUrl: https://github.com/rstaib
authorImageUrl: https://avatars0.githubusercontent.com/u/4325318?s=100&v=4
---

This blog article was previously published on http://www.rafaelstaib.com/post/How-to-create-a-Form-Wizard-using-jQuery-Steps.
This blog article was previously published on <http://www.rafaelstaib.com/post/How-to-create-a-Form-Wizard-using-jQuery-Steps>.

## Motivation

Expand Down
1 change: 0 additions & 1 deletion website/src/blog/2018-09-02-hot-chocolate-0.4.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,3 @@ 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 behavior.

Subscriptions is one of our last spec gaps.

1 change: 0 additions & 1 deletion website/src/blog/2019-03-19-logging-with-hotchocolate.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,3 @@ Another example is our [Apollo Tracing implementation](https://github.com/Chilli
I hope this little field trip into our instrumentation API gives a little outlook of an often-overlooked feature that is coming with version 9. All of what I showed in this blog is available with preview 5 (9.0.0-preview.5) that we released today.

We will add stitching related events with the next view preview builds.

1 change: 0 additions & 1 deletion website/src/blog/2019-03-31-hot-chocolate-0.8.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,3 @@ For more information on what other bugs we fixed head over to our [changelog](ht
## Version 9 Development

We have made a lot of headway with the new type system that is coming with version 9. Also, we are working on the `@defer` directive at the moment. We will give a more detailed update on the next major version in a separate blog post. Version 9 is really shaping up to become our biggest release so far.

2 changes: 1 addition & 1 deletion website/src/blog/2019-04-11-integration-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ result.MatchSnapshot(o =>

For more information about how snapshooter works head over to their repository:

https://github.com/SwissLife-OSS/snapshooter
<https://github.com/SwissLife-OSS/snapshooter>

## Schema Tests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ We have explored tooling with which we can explore the schema before issuing the

If we would print our schema it would now look like the following.

> The schema SDL can be downloaded from http://localhost:5000/schema.
> The schema SDL can be downloaded from <http://localhost:5000/schema>.

```graphql
schema {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ You can drill down on each one if these queries, and see the actual query as wel

Just like for the `ConsoleQueryLogger` class, we need to create a similar class for our MiniProfiler to work. I've done that in our example repository and named the class `MiniProfilerQueryLogger`.

https://github.com/pkellner/hot-chocolate-query-logging/blob/main/MiniProfilerQueryLogger.cs
<https://github.com/pkellner/hot-chocolate-query-logging/blob/main/MiniProfilerQueryLogger.cs>

It also implements `DiagosticEventListener` just like `ConsoleQueryLogger` did. It gets passed in the request context, but instead of logging to the console with the `ILogger` interface and the `ConsoleLoggerExtension`, it simply calls the MiniProfiler API directly.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ We have explored tooling with which we can explore the schema before issuing the

If we would print our schema it would now look like the following.

> The schema SDL can be downloaded from http://localhost:5000/schema.
> The schema SDL can be downloaded from <http://localhost:5000/schema>.

```graphql
schema {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,14 +614,18 @@ dotnet install HotChocolate.Data.Marten
With version 12, we introduced the Azure Functions integration but only targeted in-process Azure Functions. Now, with Hot Chocolate 13, we have doubled down on Azure Functions and provided the ability to now run in the isolated process model, along with templates for both.

1. Install the HotChocolate Templates.

```bash
dotnet new install HotChocolate.templates
```

2. Chose your template to install or take a spin with both.

```bash
dotnet new graphql-azf --output .\hc-graphql-azf
dotnet new graphql-azf-ip --output .\hc-graphql-azf-ip
```

Or use Visual Studio.
![HotChocolate Azure Functions Project Templates](az-func-templates-vs.png)

Expand Down
27 changes: 15 additions & 12 deletions website/src/docs/bananacakepop/v2/apis/client-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ title: "Client Registry"
---

![Image](images/client-registry-1.png)
The client registries is an important tool for managing your GraphQL Clients. It provides a centralized location for clients and queries.
The client registries is an important tool for managing your GraphQL Clients. It provides a centralized location for clients and queries.

You can use the client registry to manage your clients and their queries. It allows you to validate your queries against the schema, ensuring that all the operations defined by a client are compatible with the current schema. This validation step is critical to prevent the execution of invalid queries that might result in runtime errors.

# Understanding Clients
# Understanding Clients

A client, in the context of a GraphQL API, is an entity that interacts with the API by defining and executing GraphQL operations. These operations are stored on the API as persisted queries.

Expand Down Expand Up @@ -36,11 +36,11 @@ The number of active client versions can vary depending on the nature of the cli

On the other hand, for mobile clients, you often have multiple versions active simultaneously. This is because users may be using different versions of the app, and not all users update their apps at the same time.

Once a client version is no longer in use, it reaches its end of life. At this point, you can unpublish the client version from the client registry. This will remove its persisted queries from distribution, and they will no longer be validated against the schema.
Once a client version is no longer in use, it reaches its end of life. At this point, you can unpublish the client version from the client registry. This will remove its persisted queries from distribution, and they will no longer be validated against the schema.

## The Operations File

In the context of GraphQL, the operations file is a structured file that holds a collection of persisted queries for a client. This file serves as a reference for the client to manage and execute specific operations against a GraphQL API.
In the context of GraphQL, the operations file is a structured file that holds a collection of persisted queries for a client. This file serves as a reference for the client to manage and execute specific operations against a GraphQL API.

### Understanding the Format and Structure

Expand All @@ -64,17 +64,17 @@ Several GraphQL clients have built-in support for this Relay-style operations fi

# Setting Up a Client Registry

To set up a client registry, first, visit `eat.bananacakepop.com` and sign up for an account. Next, you'll need to download and install Barista, the .NET tool used to manage your client registry. You can find more information about Barista in the [Barista Documentation](/docs/barista/v1).
To set up a client registry, first, visit `eat.bananacakepop.com` and sign up for an account. Next, you'll need to download and install Barista, the .NET tool used to manage your client registry. You can find more information about Barista in the [Barista Documentation](/docs/barista/v1).

After installing Barista, create a new API either through the Bananacakepop UI or the CLI. In the UI, simply right-click the document explorer and select "New API." If you prefer using the CLI, ensure you're logged in with the command `barista login`, then create a new API with the command `barista api create`. With these steps complete, you are ready to start using the client registry.

To get the id of your API, use the command `barista api list`. This command will list all of your APIs, their names, and their ids. You will need the id of your API to perform most operations on the schema registry.
To get the id of your API, use the command `barista api list`. This command will list all of your APIs, their names, and their ids. You will need the id of your API to perform most operations on the schema registry.

# Using Persisted Queries

To use persisted queries, the server needs to know how to translate the hash into the corresponding GraphQL operation. This is where the client registry comes in. The client registry maintains a mapping of hashes to query keys, informing the server which hash corresponds to which query. This allows the server to efficiently look up and execute the appropriate query when it receives a request from a client.

To connect your HotChocolate server to the client registry, you need the `BananaCakePop.Services` NuGet package. This package contains the `AddBananaCakePopServices()` extension method, which can be used to configure the client registry.
To connect your HotChocolate server to the client registry, you need the `BananaCakePop.Services` NuGet package. This package contains the `AddBananaCakePopServices()` extension method, which can be used to configure the client registry.

To install the Banana Cake Pop services, run the following command in your project's root directory:

Expand Down Expand Up @@ -103,9 +103,11 @@ public void ConfigureServices(IServiceCollection services)
> **Tip: Using Environment Variables**
>
> Alternatively, you can set the required values using environment variables. This method allows you to call `AddBananaCakePopServices` without explicitly passing parameters.
>
>- `BCP_API_KEY` maps to `ApiKey`
>- `BCP_API_ID` maps to `ApiId`
>- `BCP_STAGE` maps to `Stage`
>
>```csharp
>public void ConfigureServices(IServiceCollection services)
>{
Expand All @@ -116,10 +118,12 @@ public void ConfigureServices(IServiceCollection services)
> .UsePersistedQueryPipeline(); // Enable the persisted query pipeline
>}
>```
>
>In this setup, the API key, ID, and stage are set through environment variables.

## Block Ad-Hoc Queries
While you want to allow ad-hoc queries during development, you might want to disable them in production.
## Block Ad-Hoc Queries

While you want to allow ad-hoc queries during development, you might want to disable them in production.
This can be done by setting the `OnlyAllowPersistedQueries` option to `true` in the `ModifyRequestOptions` method.

```csharp
Expand All @@ -134,7 +138,7 @@ public void ConfigureServices(IServiceCollection services)
}
```

You can also customize the error message that is returned when an ad-hoc query is sent to the server.
You can also customize the error message that is returned when an ad-hoc query is sent to the server.

```csharp
public void ConfigureServices(IServiceCollection services)
Expand All @@ -154,7 +158,6 @@ public void ConfigureServices(IServiceCollection services)
}
```


# Integrating with Continuous Integration

Integrating the client registry into your Continuous Integration/Continuous Deployment (CI/CD) pipeline maximizes their benefits. It ensures that the clients in your API are always up-to-date and tested against potential breaking changes.
Expand All @@ -167,7 +170,7 @@ As you release new versions of your clients, the client registry helps manage th

The general flow for the client registry involves three main steps: validating the client, uploading it to the registry, and publishing it.

1. **Validate the Client**: The first step takes place during your Pull Request (PR) build. Here, you validate the client against the API using `barista client validate` command. This ensures that the client is compatible with the API and will not break existing functionality.
1. **Validate the Client**: The first step takes place during your Pull Request (PR) build. Here, you validate the client against the API using `barista client validate` command. This ensures that the client is compatible with the API and will not break existing functionality.

2. **Upload the Client**: The second step takes place during your release build. Here, you upload the client to the registry using the `barista client upload` command. This command requires the `--tag` and `--api-id` options. The `--tag` option specifies the tag for the client, and the `--api-id` option specifies the ID of the API to which you are uploading. This command create a new version of the client with the specified tag.
The tag is a string that can be used to identify the client. It can be any string, but it is recommended to use a version number, such as `v1` or `v2`; or a commit hash, such as `a1b2c3d4e5f6g7h8i9j0k1l2m3n`. The tag is used to identify the client when publishing it.
Expand Down
Loading
Loading