No client is generated with StrawberryShake

2.9k views Asked by At

I am using Strawberry Shake The schema seems to be generated just fine
enter image description here

When i build i dont see any generated folder . Seems there is no client generated . I am doing something wrong here ?

2

There are 2 answers

1
Fuzzycheck On

I had the same issue and found the solution on this page: https://bartwullems.blogspot.com/2021/10/graphqlstrawberry-shake-graphql-client.html

First, your screenshot shows no query created. You need first to create a query file, like for example AddMovieData.graphql

query FetchGenreList{ genreList{ genreId, genreName } }

You need to edit the properties of AddMovieData.graphql and set the build action for the graphql file to GraphQL compiler.

Cheers

0
Paul L On

Adding onto Fuzzycheck's response. I encountered an issue where I couldn't set the build action to GraphQL Compiler. You can get around this by going into the .csproj file and adding:

<ItemGroup>
    <None Update="GraphQL\AddMovieData.graphql">
        <Generator>MSBuild:GenerateGraphQLCode</Generator>
    </None>
<ItemGroup>

I noticed this is an issue with VS2022. With Rider it generates the right code in the csproj and generates the graphql c# code.