Skip to content

Commit

Permalink
fixed broken links (#5813)
Browse files Browse the repository at this point in the history
  • Loading branch information
rstaib authored Feb 8, 2023
1 parent d99b1cf commit 72f1f60
Show file tree
Hide file tree
Showing 29 changed files with 117 additions and 54 deletions.
8 changes: 7 additions & 1 deletion website/config/conf.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ server {

error_page 404 /404/index.html;

set $latest v12;

location / {
# temporary redirects
rewrite ^/products/hotchocolate/?$ /docs/hotchocolate/$latest redirect;
rewrite ^/products/strawberryshake/?$ /docs/strawberryshake/$latest redirect;

# permanent redirects
rewrite ^/banana-cake-pop/?$ /products/bananacakepop permanent;
rewrite ^/company/?$ / permanent;
rewrite ^/products/?$ / permanent;
Expand All @@ -16,7 +23,6 @@ server {
}

location /docs {
set $latest v12;
set $hc /docs/hotchocolate/$latest;

# docs -> hotchocolate
Expand Down
25 changes: 24 additions & 1 deletion website/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const git = require("simple-git/promise");

/** @type import('gatsby').GatsbyNode["createPages"] */
exports.createPages = async ({ actions, graphql, reporter }) => {
const { createPage } = actions;
const { createPage, createRedirect } = actions;

const result = await graphql(`
{
Expand Down Expand Up @@ -59,6 +59,29 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
const products = result.data.productsConfig.products;

createDocPages(createPage, result.data.docs, products);

const latestHcVersion = products?.find(
(product) => product?.path === "hotchocolate"
)?.latestStableVersion;
const latestSsVersion = products?.find(
(product) => product?.path === "strawberryshake"
)?.latestStableVersion;

// temporary client-side redirects for missing product pages
// need to be kept till the product pages are created
// for SEO we have also configured redirects in NGINX
createRedirect({
fromPath: `/products/hotchocolate`,
toPath: `/docs/hotchocolate/${latestHcVersion}`,
redirectInBrowser: true,
isPermanent: false,
});
createRedirect({
fromPath: `/products/strawberryshake`,
toPath: `/docs/strawberryshake/${latestSsVersion}`,
redirectInBrowser: true,
isPermanent: false,
});
};

exports.onCreateNode = async ({ node, actions, getNode, reporter }) => {
Expand Down
19 changes: 7 additions & 12 deletions website/plugins/gatsby-plugin-validate-links/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,15 @@ exports.onPreBuild = async ({
activity.panicOnBuild("Document cache failed to load");
}

// Unversioned pages are currently created in a special way and only to be
// backwards compatible. All but the root links should be versioned anyways
// so the link validation will not throw errors.
// We hardcode the root documents here to satisfy the link validation,
// if pages refer to the unversioned root page of a product.
const hardcodedPages = [
"/docs/hotchocolate",
"/docs/strawberryshake",
"/docs/bananacakepop",
const knownLinks = [
"/products/bananacakepop",
"/products/hotchocolate",
"/products/strawberryshake",
];

hardcodedPages.forEach((hardcodedPage) => {
documents[hardcodedPage] = {
slug: hardcodedPage,
knownLinks.forEach((knownLink) => {
documents[knownLink] = {
slug: knownLink,
links: [],
headingAnchors: [],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

## Testing a GraphQL Server

In order to now query our GraphQL server we need a GraphQL IDE to formulate queries and explore the schema. If you want a deluxe GraphQL IDE as an application, you can get our very own Banana Cake Pop which can be downloaded [here](/docs/bananacakepop).
In order to now query our GraphQL server we need a GraphQL IDE to formulate queries and explore the schema. If you want a deluxe GraphQL IDE as an application, you can get our very own Banana Cake Pop which can be downloaded [here](/products/bananacakepop).

![Hot Chocolate](banana-cake-pop.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,4 +711,4 @@ We are doing as before a community gathering where we will walk you through all
[rafael]: https://twitter.com/rafaelstaib
[pascal]: https://twitter.com/Pascal_Senn
[fred]: https://github.com/fredericbirke
[documentation]: /docs/strawberryshake
[documentation]: /products/strawberryshake
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

## Testing a GraphQL Server

In order to now query our GraphQL server we need a GraphQL IDE to formulate queries and explore the schema. If you want a deluxe GraphQL IDE as an application, you can get our very own Banana Cakepop which can be downloaded [here](/docs/bananacakepop).
In order to now query our GraphQL server we need a GraphQL IDE to formulate queries and explore the schema. If you want a deluxe GraphQL IDE as an application, you can get our very own Banana Cake Pop which can be downloaded [here](/products/bananacakepop).

![Hot Chocolate](banana-cake-pop.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ public class InvalidUserNameError

The error object shape defines the error type shape on our schema and ensures that even if the exception is refactored to have more or less information, we do not accidentally expose information that we do not want to expose.

You can read more about all of this in our [documentation](https://chillicream.com/docs/hotchocolate/defining-a-schema/mutations/#conventions). The documentation also outlines more variants to create user errors.
You can read more about all of this in our [documentation](https://chillicream.com/docs/hotchocolate/v12/defining-a-schema/mutations/#conventions). The documentation also outlines more variants to create user errors.
One last aspect before we move on to the next topic. We also thought about result objects where a service we use does not use exceptions but already has error objects. Or F# code where we might have a union representing a result and its errors. We do not yet support these kinds of things but will further iterate on the current conventions to include these approaches towards results and errors in the future.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ With all this in place, we can execute requests against our demo server and insp

The complete example can be found [here](https://github.com/ChilliCream/graphql-platform-examples/tree/master/misc/OpenTelemetry).

Docs can be found [here](https://chillicream.com/docs/hotchocolate/server/instrumentation/#opentelemetry).
Docs can be found [here](https://chillicream.com/docs/hotchocolate/v12/server/instrumentation/#opentelemetry).

# `OneOf` Input Objects

One of the most asked-for features in GraphQL is input unions. The GraphQL working group has been discussing this feature for a long time, and we have explored multiple roads to achieve this. The most likely candidate has become the _`OneOf` Input Object_ representing a structural union. A structural union means that _`OneOf` Input Object_ is a special kind of input object where each field represents one choice. The _`OneOf` Input Object_ will only allow one field to be set, and the value can not be null. The type system enforces the rules for `OneOf` Input Objects_.
One of the most asked-for features in GraphQL is input unions. The GraphQL working group has been discussing this feature for a long time, and we have explored multiple roads to achieve this. The most likely candidate has become the _`OneOf` Input Object_ representing a structural union. A structural union means that _`OneOf` Input Object_ is a special kind of input object where each field represents one choice. The _`OneOf` Input Object_ will only allow one field to be set, and the value can not be null. The type system enforces the rules for `OneOf` Input Objects\_.

We support _`OneOf` Input Objects_ in all three schema-building approaches (annotation-based, code-first, and schema-first.

Expand Down Expand Up @@ -127,7 +127,7 @@ builder.Services

The complete example can be found [here](https://github.com/ChilliCream/graphql-platform-examples/tree/master/misc/OneOf).

Docs can be found [here](https://chillicream.com/docs/hotchocolate/defining-a-schema/input-object-types/#oneof-input-objects).
Docs can be found [here](https://chillicream.com/docs/hotchocolate/v12/defining-a-schema/input-object-types/#oneof-input-objects).

The current GraphQL spec RFC can be found [here](https://github.com/graphql/graphql-spec/pull/825).

Expand Down
9 changes: 5 additions & 4 deletions website/src/components/layout/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const Footer: FC = () => {
products: childrenDocsJson {
path
title
latestStableVersion
versions {
path
}
Expand Down Expand Up @@ -103,17 +104,17 @@ export const Footer: FC = () => {
<Title>Products</Title>
<Navigation>
<NavLink to="/products/bananacakepop">Banana Cake Pop</NavLink>
<NavLink to="/docs/hotchocolate">Hot Chocolate</NavLink>
<NavLink to="/docs/strawberryshake">Strawberry Shake</NavLink>
<NavLink to="/products/hotchocolate">Hot Chocolate</NavLink>
<NavLink to="/products/strawberryshake">Strawberry Shake</NavLink>
</Navigation>
</Links>
<Links>
<Title>Developers</Title>
<Navigation>
{products!.map((product, index) => (
<NavLink
key={`products-item-${index}`}
to={`/docs/${product!.path!}/`}
key={`doc-item-${index}`}
to={`/docs/${product!.path!}/${product!.latestStableVersion!}`}
>
{product!.title}
</NavLink>
Expand Down
9 changes: 5 additions & 4 deletions website/src/components/layout/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const Header: FC = () => {
products: childrenDocsJson {
path
title
latestStableVersion
versions {
path
}
Expand Down Expand Up @@ -363,14 +364,14 @@ const ProductsNavItem: FC<ProductsNavItemProps> = ({ firstBlogPost }) => {
with ease.
</TileLinkDescription>
</TileLink>
<TileLink to="/docs/hotchocolate" onClick={hideSubNav}>
<TileLink to="/products/hotchocolate" onClick={hideSubNav}>
<TileLinkTitle>Hot Chocolate</TileLinkTitle>
<TileLinkDescription>
The server to create high-performance <em>.NET GraphQL</em> APIs in
no time.
</TileLinkDescription>
</TileLink>
<TileLink to="/docs/strawberryshake" onClick={hideSubNav}>
<TileLink to="/products/strawberryshake" onClick={hideSubNav}>
<TileLinkTitle>Strawberry Shake</TileLinkTitle>
<TileLinkDescription>
The client to create modern <em>.NET</em> apps that consume{" "}
Expand Down Expand Up @@ -415,7 +416,7 @@ const ProductsNavItem: FC<ProductsNavItemProps> = ({ firstBlogPost }) => {

interface DeveloperNavItemProps {
readonly products: Maybe<
Pick<DocsJson, "path" | "title"> & {
Pick<DocsJson, "path" | "title" | "latestStableVersion"> & {
versions?: Maybe<Maybe<Pick<DocsJsonVersions, "path">>[]>;
}
>[];
Expand All @@ -434,7 +435,7 @@ const DeveloperNavItem: FC<DeveloperNavItemProps> = ({ products, tools }) => {
{products.map((product, index) => (
<SubNavLink
key={index}
to={`/docs/${product!.path!}/`}
to={`/docs/${product!.path!}/${product?.latestStableVersion}`}
onClick={hideSubNav}
>
<IconContainer size={16}>
Expand Down
2 changes: 1 addition & 1 deletion website/src/docs/bananacakepop/v2/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Introduction"

> Try it out and give us feedback via [slack](http://slack.chillicream.com/) in the **#banana-cake-pop** channel.
Banana Cake Pop is a GraphQL IDE that makes it easy and enjoyable to test your GraphQL server implementations. It works well with [Hot Chocolate](/docs/hotchocolate) and any other GraphQL server.
Banana Cake Pop is a GraphQL IDE that makes it easy and enjoyable to test your GraphQL server implementations. It works well with [Hot Chocolate](/products/hotchocolate) and any other GraphQL server.

![Banana Cake Pop - Operations](../../shared/bcp/bcp-operations.png)

Expand Down
2 changes: 1 addition & 1 deletion website/src/docs/hotchocolate/v10/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,4 @@ In order to get you even faster started we are providing templates for the dotne

![Banana Cake Pop](../../shared/bcp_6.png)

[Learn more](/docs/bananacakepop)
[Learn more](/products/bananacakepop)
2 changes: 1 addition & 1 deletion website/src/docs/hotchocolate/v10/tooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: "Tooling"

Banana Cake Pop is our brand new GraphQL IDE which works well with Hot Chocolate and any other GraphQL server.

[Learn more](/docs/bananacakepop)
[Learn more](/products/bananacakepop)

# Visual Studio Integration

Expand Down
2 changes: 1 addition & 1 deletion website/src/docs/hotchocolate/v11/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Now that your server is finished let us try it out by executing a simple GraphQL
dotnet run --project ./Demo
```

2. Open your browser and head over to `http://localhost:5000/graphql` to open our built-in GraphQL IDE [Banana Cake Pop](/docs/bananacakepop).
2. Open your browser and head over to `http://localhost:5000/graphql` to open our built-in GraphQL IDE [Banana Cake Pop](/products/bananacakepop).

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

Expand Down
2 changes: 1 addition & 1 deletion website/src/docs/hotchocolate/v11/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Introduction"
---

Hot Chocolate is an open-source GraphQL server for the [Microsoft .NET platform](https://dotnet.microsoft.com/) that is compliant with the newest [GraphQL October 2021 spec + Drafts](https://spec.graphql.org/), which makes Hot Chocolate compatible to all GraphQL compliant clients like [Strawberry Shake](/docs/strawberryshake), [Relay](https://relay.dev/), [Apollo Client](https://www.apollographql.com/docs/react/), [various other GraphQL clients and tools](https://graphql.org/code).
Hot Chocolate is an open-source GraphQL server for the [Microsoft .NET platform](https://dotnet.microsoft.com/) that is compliant with the newest [GraphQL October 2021 spec + Drafts](https://spec.graphql.org/), which makes Hot Chocolate compatible to all GraphQL compliant clients like [Strawberry Shake](/products/strawberryshake), [Relay](https://relay.dev/), [Apollo Client](https://www.apollographql.com/docs/react/), [various other GraphQL clients and tools](https://graphql.org/code).

Hot Chocolate takes the complexity away from building a fully-fledged GraphQL server and lets you focus on delivering the next big thing.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ The Project can be started by either pressing `Ctrl + F5` or clicking the green
</InputChoiceTabs.VisualStudio>
</InputChoiceTabs>

If you have setup everything correctly, you should be able to open <a href="http://localhost:5000/graphql" target="_blank" rel="noopener noreferrer">http://localhost:5000/graphql</a> (the port might be different for you) in your browser and be greeted by our GraphQL IDE [Banana Cake Pop](/docs/bananacakepop).
If you have setup everything correctly, you should be able to open <a href="http://localhost:5000/graphql" target="_blank" rel="noopener noreferrer">http://localhost:5000/graphql</a> (the port might be different for you) in your browser and be greeted by our GraphQL IDE [Banana Cake Pop](/products/bananacakepop).

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: "In this section, you will learn how to use persisted queries in Gr

Persisted queries allow us to pre-register all required queries of our clients. This can be done by extracting the queries of our client applications at build time and placing them in the server's query storage.

Extracting queries is supported by client libraries like [Relay](https://relay.dev/docs/guides/persisted-queries/) and in the case of [Strawberry Shake](/docs/strawberryshake) we do not have to do any additional work.
Extracting queries is supported by client libraries like [Relay](https://relay.dev/docs/guides/persisted-queries/) and in the case of [Strawberry Shake](/products/strawberryshake) we do not have to do any additional work.

> Note: While this feature is called persisted _queries_ it works for all other GraphQL operations as well.
Expand Down
6 changes: 3 additions & 3 deletions website/src/docs/hotchocolate/v12/server/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Endpoints
---

Hot Chocolate comes with a set of ASP.NET Core middleware used for making the GraphQL server available via HTTP and WebSockets. There are also middleware for hosting our GraphQL IDE [Banana Cake Pop](/docs/bananacakepop) as well as an endpoint used for downloading the schema in its SDL representation.
Hot Chocolate comes with a set of ASP.NET Core middleware used for making the GraphQL server available via HTTP and WebSockets. There are also middleware for hosting our GraphQL IDE [Banana Cake Pop](/products/bananacakepop) as well as an endpoint used for downloading the schema in its SDL representation.

# MapGraphQL

Expand Down Expand Up @@ -50,7 +50,7 @@ Calling `MapGraphQL()` will enable the following functionality on the specified
- HTTP GET and HTTP POST GraphQL requests are handled (Multipart included)
- WebSocket GraphQL requests are handled (if the ASP.NET Core WebSocket Middleware has been registered)
- Including the query string `?sdl` after the endpoint will download the GraphQL schema
- Accessing the endpoint from a browser will load our GraphQL IDE [Banana Cake Pop](/docs/bananacakepop)
- Accessing the endpoint from a browser will load our GraphQL IDE [Banana Cake Pop](/products/bananacakepop)

We can customize the combined middleware using `GraphQLServerOptions` as shown below or we can only include the parts of the middleware we need and configure them explicitly.

Expand Down Expand Up @@ -143,7 +143,7 @@ public class Startup

# MapBananaCakePop

We can call `MapBananaCakePop()` on the `IEndpointRouteBuilder` to serve [Banana Cake Pop](/docs/bananacakepop) on a different endpoint than the actual GraphQL endpoint.
We can call `MapBananaCakePop()` on the `IEndpointRouteBuilder` to serve [Banana Cake Pop](/products/bananacakepop) on a different endpoint than the actual GraphQL endpoint.

```csharp
public class Startup
Expand Down
2 changes: 1 addition & 1 deletion website/src/docs/hotchocolate/v12/server/files.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Both Relay and Apollo support this specification through community packages:
- [react-relay-network-modern](https://github.com/relay-tools/react-relay-network-modern) using the `uploadMiddleware`
- [apollo-upload-client](https://github.com/jaydenseric/apollo-upload-client)

> Warning: [Strawberry Shake](/docs/strawberryshake) does not yet support the `Upload` scalar.
> Warning: [Strawberry Shake](/products/strawberryshake) does not yet support the `Upload` scalar.
### Options

Expand Down
2 changes: 1 addition & 1 deletion website/src/docs/hotchocolate/v12/server/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In this section, you will learn how you can configure your GraphQL server and we

# Endpoints

Hot Chocolate comes with ASP.NET Core endpoint middleware for accepting HTTP / WebSocket GraphQL requests, downloading the GraphQL schema, or serving the [Banana Cake Pop](/docs/bananacakepop) GraphQL IDE.
Hot Chocolate comes with ASP.NET Core endpoint middleware for accepting HTTP / WebSocket GraphQL requests, downloading the GraphQL schema, or serving the [Banana Cake Pop](/products/bananacakepop) GraphQL IDE.

[Learn more about endpoints](/docs/hotchocolate/v12/server/endpoints)

Expand Down
2 changes: 1 addition & 1 deletion website/src/docs/hotchocolate/v12/server/introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Introspection
---

Introspection is what enables GraphQL's rich tooling ecosystem as well powerful IDEs like [Banana Cake Pop](/docs/bananacakepop) or GraphiQL.
Introspection is what enables GraphQL's rich tooling ecosystem as well powerful IDEs like [Banana Cake Pop](/products/bananacakepop) or GraphiQL.

Every GraphQL server exposes a `__schema` and `__type` field on the query type as well as an `__typename` field on each type. These fields are used to gain insights into the schema of our GraphQL server.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ The Project can be started by either pressing `Ctrl + F5` or clicking the green
</InputChoiceTabs.VisualStudio>
</InputChoiceTabs>

If you have setup everything correctly, you should be able to open <a href="http://localhost:5000/graphql" target="_blank" rel="noopener noreferrer">http://localhost:5000/graphql</a> (the port might be different for you) in your browser and be greeted by our GraphQL IDE [Banana Cake Pop](/docs/bananacakepop).
If you have setup everything correctly, you should be able to open <a href="http://localhost:5000/graphql" target="_blank" rel="noopener noreferrer">http://localhost:5000/graphql</a> (the port might be different for you) in your browser and be greeted by our GraphQL IDE [Banana Cake Pop](/products/bananacakepop).

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

Expand Down
Loading

0 comments on commit 72f1f60

Please sign in to comment.