Skip to content

Commit

Permalink
Added support for persisted queries to StrawberryShake
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Aug 31, 2022
1 parent 3e6c7ac commit 4b7ad3c
Show file tree
Hide file tree
Showing 9 changed files with 204 additions and 159 deletions.
Expand Up @@ -10,6 +10,11 @@
<GraphQLRequestHash>md5</GraphQLRequestHash>
<!--intermediate/project-->
<GraphQLOutput>intermediate</GraphQLOutput>
<!--A relative path from the project root to where the persisted queries output dir-->
<GraphQLPersistedQueryOutput></GraphQLPersistedQueryOutput>
<!--default/relay-->
<GraphQLPersistedQueryFormat>default</GraphQLPersistedQueryFormat>
<!--enable/disable-->
<GraphQLDebug>disable</GraphQLDebug>
</PropertyGroup>

Expand Down
Expand Up @@ -22,16 +22,19 @@
Condition="'@(GraphQL)' != ''">
<PropertyGroup>
<GraphQLCodeGenerationRoot>$(MSBuildProjectDirectory)\$(IntermediateOutputPath)berry\</GraphQLCodeGenerationRoot>
<GraphQLQueryGenerationRoot>$(MSBuildProjectDirectory)\$(GraphQLPersistedQueryFormat)</GraphQLQueryGenerationRoot>
</PropertyGroup>

<PropertyGroup>
<GenCommand>dotnet $(GenTool) generate "$(MSBuildProjectDirectory)"</GenCommand>
<GenCommand>$(GenCommand) -o "$(GraphQLCodeGenerationRoot)"</GenCommand>
<GenCommand Condition="'$(RootNamespace)' != ''">$(GenCommand) -n "$(RootNamespace)"</GenCommand>
<GenCommand Condition="'$(GraphQLPersistedQueryOutput)' != ''">$(GenCommand) -q "$(GraphQLQueryGenerationRoot)"</GenCommand>
<GenCommand Condition="'$(GraphQLRequestHash)' != ''">$(GenCommand) -a "$(GraphQLRequestHash)"</GenCommand>
<GenCommand Condition="'$(GraphQLStrictSchemaValidation)' != 'enable'">$(GenCommand) -s</GenCommand>
<GenCommand Condition="'$(GraphQLClientStore)' != 'enable'">$(GenCommand) -t</GenCommand>
<GenCommand Condition="'$(GraphQLRazorComponents)' == 'enable'">$(GenCommand) -r</GenCommand>
<GenCommand Condition="'$(GraphQLPersistedQueryFormat)' == 'relay'">$(GenCommand) --relayFormat</GenCommand>
</PropertyGroup>

<Message Text="MSBuildProjectDirectory: $(MSBuildProjectDirectory)" Importance="High" Condition="'$(GraphQLDebug)' == 'enable'" />
Expand Down
Expand Up @@ -10,6 +10,11 @@
<GraphQLRequestHash>md5</GraphQLRequestHash>
<!--intermediate/project-->
<GraphQLOutput>intermediate</GraphQLOutput>
<!--A relative path from the project root to where the persisted queries output dir-->
<GraphQLPersistedQueryOutput></GraphQLPersistedQueryOutput>
<!--default/relay-->
<GraphQLPersistedQueryFormat>default</GraphQLPersistedQueryFormat>
<!--enable/disable-->
<GraphQLDebug>disable</GraphQLDebug>
</PropertyGroup>

Expand Down
Expand Up @@ -10,6 +10,11 @@
<GraphQLRequestHash>md5</GraphQLRequestHash>
<!--intermediate/project-->
<GraphQLOutput>intermediate</GraphQLOutput>
<!--A relative path from the project root to where the persisted queries output dir-->
<GraphQLPersistedQueryOutput></GraphQLPersistedQueryOutput>
<!--default/relay-->
<GraphQLPersistedQueryFormat>default</GraphQLPersistedQueryFormat>
<!--enable/disable-->
<GraphQLDebug>disable</GraphQLDebug>
</PropertyGroup>

Expand Down
4 changes: 3 additions & 1 deletion src/StrawberryShake/Tooling/.vscode/launch.json
Expand Up @@ -13,11 +13,13 @@
"generate",
"/Users/michael/local/play/StrawberryBuildTests",
"-o /Users/michael/local/play/StrawberryBuildTests/obj/Debug/net7.0/berry/",
"-q /Users/michael/local/play/StrawberryBuildTests/obj/Debug/net7.0/berry/q",
"-n StrawberryBuildTests",
"-a md5",
"-s",
"-t",
"-r"
"-r",
"--relayFormat"
],
"cwd": "${workspaceFolder}/src/dotnet-graphql",
"console": "internalConsole",
Expand Down
121 changes: 0 additions & 121 deletions src/StrawberryShake/Tooling/src/dotnet-graphql/ExportCommand.cs

This file was deleted.

0 comments on commit 4b7ad3c

Please sign in to comment.