Skip to content

Commit

Permalink
Fix schema outputs for workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-watson committed Oct 19, 2023
1 parent 282925d commit 948458a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
curl -sSL https://rover.apollo.dev/nix/latest | sh
echo "$HOME/.rover/bin" >> $GITHUB_PATH
- name: Generate Schema
run: dotnet run -- schema export --output schema.graphqls
run: dotnet run --project Server -- schema export --output ../schema.graphql
- name: Schema Check
run: rover subgraph check ${{ secrets.APOLLO_GRAPH_REF }} --schema schema.graphqls --name ${{ env.SUBGRAPH_NAME }}
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
publish_schema:
name: Publish new schema to Apollo Studio
if: false
needs: [ deploy ]
needs: [deploy]
env:
APOLLO_VCS_COMMIT: ${{ github.event.pull_request.head.sha }}
# rename this to a valid subgraph name
Expand All @@ -54,7 +54,7 @@ jobs:
curl -sSL https://rover.apollo.dev/nix/latest | sh
echo "$HOME/.rover/bin" >> $GITHUB_PATH
- name: Generate Schema
run: dotnet run -- schema export --output schema.graphqls
run: dotnet run --project Server -- schema export --output ../schema.graphql
- name: Publish Schema
run: rover subgraph publish ${{ secrets.APOLLO_GRAPH_REF }} --schema src/main/resources/graphql/schema.graphqls --name ${{ env.SUBGRAPH_NAME }} --routing-url ${{ secrets.PRODUCTION_URL }}
env:
Expand Down
13 changes: 13 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "generate-schema",
"command": "dotnet run --project Server -- schema export --output ../schema.graphql",
"type": "shell",
"problemMatcher": "$msCompile"
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# .NET HotChocolate Federated GraphQL Subgraph

[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/MeiYeR?referralCode=neALOu)
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/asB7Lh?referralCode=neALOu)

This is an example application template that can be used to create Federated GraphQL subgraph using [HotChocolate](https://chillicream.com/docs/hotchocolate/v13). You can use this template from [Rover](https://www.apollographql.com/docs/rover/commands/template/) with `rover template use --template subgraph-dotnet-hotchocolate-annotation`.

Expand Down
3 changes: 2 additions & 1 deletion Server/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using ApolloGraphQL.HotChocolate.Federation.Two;
using HotChocolate.AspNetCore;
using HotChocolate.Execution;
using Microsoft.Extensions.Hosting;

var builder = WebApplication.CreateBuilder(args);

Expand All @@ -23,7 +24,7 @@

app.MapGraphQL();
app.MapBananaCakePop("/");
app.Run();
app.RunWithGraphQLCommandsAsync(args);

Check warning on line 27 in Server/Program.cs

View workflow job for this annotation

GitHub Actions / Build

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 27 in Server/Program.cs

View workflow job for this annotation

GitHub Actions / Build

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

public sealed class RouterAuthInterceptor : DefaultHttpRequestInterceptor
{
Expand Down

0 comments on commit 948458a

Please sign in to comment.