Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ChilliCream/graphql-platform
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 11.3.5
Choose a base ref
...
head repository: ChilliCream/graphql-platform
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 11.3.6
Choose a head ref
  • 6 commits
  • 38 files changed
  • 5 contributors

Commits on Aug 22, 2021

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Mic92 Jörg Thalheim
    Copy the full SHA
    003e815 View commit details

Commits on Aug 23, 2021

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Mic92 Jörg Thalheim
    Copy the full SHA
    ddc8479 View commit details

Commits on Aug 25, 2021

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Mic92 Jörg Thalheim
    Copy the full SHA
    9d66662 View commit details
  2. Copy the full SHA
    930df8c View commit details
  3. Updated Banana Cake Pop Documentation (#4111)

    Co-authored-by: Rafael Staib <me@rafaelstaib.com>
    arif-hanif and rstaib authored Aug 25, 2021
    Copy the full SHA
    4c85246 View commit details

Commits on Aug 31, 2021

  1. Copy the full SHA
    b6c1f85 View commit details
Showing with 384 additions and 80 deletions.
  1. +111 −0 .devops/deploy-website-cluster.yml
  2. +3 −0 .docker/website/dockerfile
  3. +22 −36 src/HotChocolate/AspNetCore/src/AspNetCore/Subscriptions/WebSocketConnection.cs
  4. +13 −14 website/src/blog/2021-07-20-rider-language-injection/2021-07-20-rider-language-injection.md
  5. BIN ...te/src/blog/2021-07-20-rider-language-injection/hot-chocolate-rider-language-injection-banner.png
  6. BIN website/src/blog/2021-07-20-rider-language-injection/rider-language-injection.png
  7. +24 −6 website/src/components/images/banana-cake-pop.tsx
  8. +21 −0 website/src/docs/bananacakepop/actions/key-bindings.md
  9. +9 −0 website/src/docs/bananacakepop/actions/schema-refresh.md
  10. +3 −0 website/src/docs/bananacakepop/documents/headers.md
  11. +3 −0 website/src/docs/bananacakepop/documents/history.md
  12. +3 −0 website/src/docs/bananacakepop/documents/linting.md
  13. +15 −0 website/src/docs/bananacakepop/documents/managing.md
  14. +3 −0 website/src/docs/bananacakepop/documents/tabs.md
  15. +3 −0 website/src/docs/bananacakepop/documents/variables.md
  16. +35 −0 website/src/docs/bananacakepop/getting-started.md
  17. +11 −3 website/src/docs/bananacakepop/index.md
  18. +5 −0 website/src/docs/bananacakepop/integrations/apollo.md
  19. +5 −0 website/src/docs/bananacakepop/integrations/express.md
  20. +5 −0 website/src/docs/bananacakepop/integrations/gatsby.md
  21. +3 −0 website/src/docs/bananacakepop/integrations/hot-chocolate.md
  22. +12 −0 website/src/docs/bananacakepop/integrations/index.md
  23. +5 −0 website/src/docs/bananacakepop/integrations/koa.md
  24. +15 −0 website/src/docs/bananacakepop/schema-definition.md
  25. +15 −0 website/src/docs/bananacakepop/schema-reference.md
  26. +20 −0 website/src/docs/docs.json
  27. +6 −4 website/src/docs/hotchocolate/api-reference/migrate-from-10-to-11.md
  28. BIN website/src/docs/shared/bcp/bcp-document-explorer.png
  29. BIN website/src/docs/shared/bcp/bcp-editor-dropdown.png
  30. BIN website/src/docs/shared/bcp/bcp-endpoint-entry.png
  31. BIN website/src/docs/shared/bcp/bcp-operations.png
  32. BIN website/src/docs/shared/bcp/bcp-schema-definition.png
  33. BIN website/src/docs/shared/bcp/bcp-schema-reference-query-type.png
  34. BIN website/src/docs/shared/bcp/bcp-sessions-query.png
  35. BIN website/src/docs/shared/bcp/bcp-sessionsbyid-query.png
  36. BIN website/src/docs/shared/bcp/bcp-start-screen.png
  37. BIN website/src/images/banana-cake-pop.png
  38. +14 −17 website/src/pages/index.tsx
111 changes: 111 additions & 0 deletions .devops/deploy-website-cluster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
trigger:
batch: true
branches:
include:
- main
- develop
paths:
include:
- .devops/deploy-website-cluster.yml
- .docker/website
- website

pr: none

pool:
vmImage: "ubuntu-20.04"

steps:
- task: DockerInstaller@0
displayName: "Install Docker"
inputs:
dockerVersion: "17.09.0-ce"

- task: KubectlInstaller@0
displayName: "Install Kubectl"
inputs:
kubectlVersion: "latest"

- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: "14.x"
checkLatest: true

- task: YarnInstaller@3
displayName: "Install Yarn"
inputs:
versionSpec: "1.x"
checkLatest: true

- task: Yarn@3
displayName: "Install Packages"
inputs:
projectDirectory: "website"
arguments: "--frozen-lockfile"

- task: Yarn@3
displayName: "Run yarn build"
inputs:
projectDirectory: "website"
arguments: "build --prefix-paths"

- task: Docker@2
displayName: "Build WebSite Container"
inputs:
containerRegistry: '$(container-registry)'
repository: 'ccc-website-$(Build.SourceBranchName)'
command: 'buildAndPush'
Dockerfile: '.docker/website/dockerfile'
buildContext: '.'

- task: Kubernetes@1
displayName: "Deploy WebSite Service"
inputs:
connectionType: "Kubernetes Service Connection"
kubernetesServiceEndpoint: "$(aks-cluster)"
namespace: "$(portal-namespace)"
command: "apply"
useConfigurationFile: true
configurationType: "inline"
inline: |
apiVersion: apps/v1
kind: Deployment
metadata:
name: ccc-website-$(Build.SourceBranchName)
spec:
replicas: 2
selector:
matchLabels:
app: ccc-website-$(Build.SourceBranchName)
template:
metadata:
labels:
app: ccc-website-$(Build.SourceBranchName)
spec:
containers:
- image: $(container-registry-domain)/ccc-website-$(Build.SourceBranchName):$(Build.BuildId)
resources:
limits:
memory: "128Mi"
cpu: "500m"
requests:
memory: "32Mi"
cpu: "1m"
name: ccc-website-$(Build.SourceBranchName)
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: ccc-website-$(Build.SourceBranchName)
spec:
type: ClusterIP
ports:
- port: 80
selector:
app: ccc-website-$(Build.SourceBranchName)
secretType: "dockerRegistry"
containerRegistryType: "Azure Container Registry"

3 changes: 3 additions & 0 deletions .docker/website/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# syntax=docker/dockerfile:1
FROM nginx:alpine
COPY ./website/public /usr/share/nginx/html
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ namespace HotChocolate.AspNetCore.Subscriptions
public class WebSocketConnection : ISocketConnection
{
private const string _protocol = "graphql-ws";
private const int _maxMessageSize = 1024 * 4;
private const int _maxMessageSize = 512;
private WebSocket? _webSocket;
private bool _disposed;

@@ -87,49 +87,35 @@ public async Task ReceiveAsync(

try
{
WebSocketReceiveResult? socketResult = null;
ValueWebSocketReceiveResult socketResult;
do
{
if (webSocket.State != WebSocketState.Open)
{
break;
}

Memory<byte> memory = writer.GetMemory(_maxMessageSize);
var success = MemoryMarshal.TryGetArray(memory, out ArraySegment<byte> buffer);
socketResult = await webSocket.ReceiveAsync(memory, cancellationToken);

if (success)
if (socketResult.Count == 0)
{
if (webSocket.State != WebSocketState.Open)
{
break;
}

try
{
socketResult = await webSocket.ReceiveAsync(buffer, cancellationToken);
if (socketResult.Count == 0)
{
break;
}

writer.Advance(socketResult.Count);
}
catch
{
break;
}

FlushResult result = await writer.FlushAsync(cancellationToken);
if (result.IsCompleted)
{
break;
}
break;
}
} while (socketResult == null || !socketResult.EndOfMessage);
}
catch (ObjectDisposedException)
{
// we will just stop receiving

writer.Advance(socketResult.Count);

FlushResult result = await writer.FlushAsync(cancellationToken);

if (result.IsCompleted)
{
break;
}
} while (!socketResult.EndOfMessage);
}
catch (WebSocketException)
catch
{
// we will just stop receiving
// swallow exception, there's nothing we can reasonably do
}
}

Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ tags:
"jetbrains",
"rider",
]
featuredImage: "rider-language-injection.png"
featuredImage: "hot-chocolate-rider-language-injection-banner.png"
author: Pascal Senn
authorUrl: https://github.com/pascal_senn
authorImageUrl: https://avatars0.githubusercontent.com/u/14233220
@@ -51,14 +51,14 @@ package [Snapshooter](https://swisslife-oss.github.io/snapshooter/docs/get-start

```csharp
[Fact]
public void ExampleUseOfSnapshooter()
public void ExampleUseOfSnapshooter()
{
// arrange
var serviceToTest = new ServiceToTest();

// act
List<string> result = serviceToTest.GetSomeStrings();

// assert
result.MatchSnapshot();
}
@@ -70,7 +70,7 @@ the name `schema.graphql`. You can configure the extension in a `.graphqlconfig`

The snapshot test to capture the schema could look like this:

*/test/ExampleProject.Tests/SchemaTests.cs*
_/test/ExampleProject.Tests/SchemaTests.cs_

```csharp
public class SchemaTests
@@ -97,7 +97,7 @@ public class SchemaTests
The example from above creates a snapshot of the schema in `/test/ExampleProject.Tests/__snapshots__/schema.graphql`. You now
have to make the GraphQL extension aware of this schema by creating a .graphqlconfig

*/test/ExampleProject.TestsYourProject.Tests/.graphqlconfig*
_/test/ExampleProject.TestsYourProject.Tests/.graphqlconfig_

```json
{
@@ -106,7 +106,7 @@ have to make the GraphQL extension aware of this schema by creating a .graphqlco
}
```

Now all *.gql and *.graphql files in your project will have proper syntax highlighting, IntelliSense and linting.
Now all _.gql and _.graphql files in your project will have proper syntax highlighting, IntelliSense and linting.

## Inject GraphQL into strings

@@ -145,18 +145,19 @@ public class PersonsIntegrationTests
}
```

The GraphQL extension now knows the schema, but Rider does not understand that the string contains a GraphQL query.
The GraphQL extension now knows the schema, but Rider does not understand that the string contains a GraphQL query.
To make Rider aware of string literals that contain GraphQL queries, you have to add a new language injection provider.

1. Go To 'Preferences' and search for 'Language Injection'
![Rider Preferences Window](./preferences.png)
2. Add a new 'Generic Csharp' Language Injection
![Rider Preferences Window](./preferences.png)
2. Add a new 'Generic Csharp' Language Injection
3. Select GraphQL in the Dropdown ID
4. Add the following pattern

```text
- csharpLiteralExpression().withText(string().matchesBrics("@?[\"'] *((query|mutation|subscription) .*) .*[\"']?"))
```

![Rider language injection-settings](./language-injection-settings.png)

Now every string in C# that starts with either `query`, `mutation`, or `subscription` will be interpreted by Rider as a GraphQL Query.
@@ -165,11 +166,9 @@ Now every string in C# that starts with either `query`, `mutation`, or `subscrip

You can find an example project here [rider-language-injection-example](https://github.com/PascalSenn/rider-language-injection-example)

In case you have questions, [Join our Slack Channel](http://slack.chillicream.com/). We have a very welcoming and helpful community that is waiting for you.


In case you have questions, [Join our Slack Channel](http://slack.chillicream.com/). We have a very welcoming and helpful community that is waiting for you.

If you like what we are doing at ChilliCream, head over to the [HotChocolate repository and **give us a star**](https://github.com/ChilliCream/hotchocolate).
If you like what we are doing at ChilliCream, head over to the [HotChocolate repository and **give us a star**](https://github.com/ChilliCream/hotchocolate).
It helps us to gain visibility and grow our already awesome community!

Thank you!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
30 changes: 24 additions & 6 deletions website/src/components/images/banana-cake-pop.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,47 @@
import { graphql, useStaticQuery } from "gatsby";
import { GatsbyImage } from "gatsby-plugin-image";
import React, { FC } from "react";
import styled from "styled-components";
import { GetBananaCakePopImageQuery } from "../../../graphql-types";

export const BananaCakePop: FC = () => {
export interface BananaCakePopProps {
readonly shadow?: boolean;
}

export const BananaCakePop: FC<BananaCakePopProps> = ({ shadow }) => {
const data = useStaticQuery<GetBananaCakePopImageQuery>(graphql`
query getBananaCakePopImage {
file(
relativePath: { eq: "banana-cake-pop.png" }
sourceInstanceName: { eq: "images" }
) {
childImageSharp {
gatsbyImageData(
layout: CONSTRAINED
width: 1200
)
gatsbyImageData(layout: CONSTRAINED, width: 1200)
}
}
}
`);

return (
return shadow ? (
<Container>
<GatsbyImage
image={data.file?.childImageSharp?.gatsbyImageData}
alt="Banana Cake Pop"
/>
</Container>
) : (
<GatsbyImage
image={data.file?.childImageSharp?.gatsbyImageData}
alt="Banana Cake Pop"
/>
);
};

const Container = styled.div`
padding: 30px;
.gatsby-image-wrapper {
border-radius: var(--border-radius);
box-shadow: 0 9px 18px rgba(0, 0, 0, 0.25);
}
`;
21 changes: 21 additions & 0 deletions website/src/docs/bananacakepop/actions/key-bindings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "Key Bindings"
---

The following key bindings can be used as shortcuts to common actions in Banana Cake Pop.

### Mac

- Open new tab: ⌘ + ⌥ + T
- Save current tab: ⌘ + S
- Open Document Explorer: ⌘ + ⌥ + D
- Open History Explorer: ⌘ + ⌥ + H
- Format Document: ⇧ + ⌥ + F

### Windows

- Open new tab: CTRL + ALT + T
- Save current tab: CTRL + S
- Open Document Explorer: CTRL + SHIFT + D
- Open History Explorer: CTRL + SHIFT + H
- Format Document: SHIFT + ALT + F
9 changes: 9 additions & 0 deletions website/src/docs/bananacakepop/actions/schema-refresh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: "Schema Refresh"
---

You can refresh the schema if it is out of sync with the server by using the following key bindings, or by click the reload schema icon next to the endpoint.

Mac: ⇧ + ⌥ + ⏎

Windows: SHIFT + ALT + ENTER
3 changes: 3 additions & 0 deletions website/src/docs/bananacakepop/documents/headers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: "Document Headers"
---
3 changes: 3 additions & 0 deletions website/src/docs/bananacakepop/documents/history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: "History Explorer"
---
3 changes: 3 additions & 0 deletions website/src/docs/bananacakepop/documents/linting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: "Linting"
---
Loading