Strawberry Shakev15
This is documentation for v15, which is currently in preview.
See the latest stable version instead.

Tooling

We are still working on the documentation for Strawberry Shake, so help us by finding typos, missing things, or write some additional docs with us.

StrawberryShake comes with some tools that integrate into the dotnet CLI and help to setup a project or update the schema of a project.

Initialize Project

dotnet graphql init http://localhost/graphql

The init command allows you to initialize a C# project for use with Strawberry Shake. It essentially creates the initial configuration file .graphqlrc.json and downloads the GraphQL schema.

dotnet graphql init {url} [-p|--Path] [-n|--clientName] [--token] [--scheme] [--tokenEndpoint] [--clientId] [--clientSecret] [--scope] [-x|--headers]

ArgumentDescription
-p or --pathThe path where the project is located.
-n or --clientNameThe name of the client, which will also become the name of the client class in C#.
--tokenA token to interact with the server.
--schemeThe token schema that shall be used.
--tokenEndpointThe token endpoint that shall be used to acquire a new token.
--clientIdThe client ID that shall be used when interacting with the tokenEndpoint.
--clientSecretThe client secret that shall be used when interacting with the tokenEndpoint.
--scopeThe scope (can be used multiple times) that shall be used when interacting with the tokenEndpoint.
-x or --headersThe headers adds additional custom headers. Example: --headers key1=value1 --headers key2=value2

Update Project

dotnet graphql update

The update command allows you to update the local GraphQL schema with the newest version of the GraphQL server.

dotnet graphql update [-p|--Path] [-u|--uri] [--token] [--scheme] [--tokenEndpoint] [--clientId] [--clientSecret] [--scope] [-x|--headers]

ArgumentDescription
-p or --pathThe path where the project is located.
-u or --uriThe GraphQL server URI that shall be used instead of the one in the graphqlrc.json
--tokenA token to interact with the server.
--schemeThe token schema that shall be used.
--tokenEndpointThe token endpoint that shall be used to acquire a new token.
--clientIdThe client ID that shall be used when interacting with the tokenEndpoint.
--clientSecretThe client secret that shall be used when interacting with the tokenEndpoint.
--scopeThe scope (can be used multiple times) that shall be used when interacting with the tokenEndpoint.
-x or --headersThe headers adds additional custom headers. Example: --headers key1=value1 --headers key2=value2

Download Schema

dotnet graphql download http://localhost/graphql

The download command allows downloading a GraphQL schema from any GraphQL server.

dotnet graphql download {url} [-f|--fileName] [--token] [--scheme] [--tokenEndpoint] [--clientId] [--clientSecret] [--scope] [-x|--headers]

ArgumentDescription
-f or --fileNameThe name of the file name. If not specified, the file will be called Schema.graphql.
--tokenA token to interact with the server.
--schemeThe token schema that shall be used.
--tokenEndpointThe token endpoint that shall be used to acquire a new token.
--clientIdThe client ID that shall be used when interacting with the tokenEndpoint.
--clientSecretThe client secret that shall be used when interacting with the tokenEndpoint.
--scopeThe scope (can be used multiple times) that shall be used when interacting with the tokenEndpoint.
-x or --headersThe headers adds additional custom headers. Example: --headers key1=value1 --headers key2=value2