ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.27k stars 748 forks source link

Strawberry Shake reports an issue in the wrong source file #3338

Open nightroman opened 3 years ago

nightroman commented 3 years ago

Strawberry Shake reports an issue in the wrong source file

StrawberryShake 11.1.0-preview.89

Please find attached the sample project.

Change to it directory and run:

dotnet build

Actual result

This correctly fails due to the existing type issue but the error points to the wrong source file:

...\HCSS_210323\GraphQL\Queries\GetCommentThread.graphql(3,27): error SS0002:
The variable `workspaceUrl` is not compatible with the type of the current
location. [...\HCSS_210323\My.Client.csproj]
    0 Warning(s)
    1 Error(s)

Note that it points to GetCommentThread.graphql. But the issue is in GetProjects.graphql.

In GetProjects.graphql change

query GetProjects($workspaceUrl: String) {

to

query GetProjects($workspaceUrl: String!) {

and build again, the build succeeds.

Expected result

The build fails and reports an issue in the correct source file GetProjects.graphql.


HCSS_210323.zip

lfoust commented 4 months ago

Just ran into this issue with StrawberryShake.Blazor 13.9.6 and changing the type from String to String! worked around the issue and allowed my project to compile