No client is generated with StrawberryShake
Asked Answered
B

2

5

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 ?

Bozovich answered 19/4, 2022 at 13:3 Comment(0)
G
6

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

Godwin answered 10/6, 2022 at 17:12 Comment(1)
Any idea why the GraphQL Compiler does show up in the build actions? Is there another package that needs to be installed?Kalamazoo
L
0

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.

Lionize answered 20/12, 2023 at 14:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.