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.28k stars 748 forks source link

Strawberry Shake's generated code does not handle custom output directory properly. #5532

Closed kellyrbourg closed 1 year ago

kellyrbourg commented 2 years ago

Is there an existing issue for this?

Describe the bug

Our repo is setup as follows. (We are using NX for managing build orchestration/targets/dependencies/artifacts). We have a custom output directory set in our root Directory.Build.props that is set to an absolute path. (/home/krbourg/code/alloy/dist)

/dist/libs/shared/infrastructure/strawberry-shake-server-client/bin/*
/dist/libs/shared/infrastructure/strawberry-shake-server-client/obj/*
/libs/share/infrastructure/strawberry-shake-server-client
/Directory.Build.props

We are seeing the Strawberry Shake code generation output files to the following location: /libs/shared/infrastructure/strawberry-shake-server-client/home/krbourg/work/code/alloy/dist/libs/shared/infrastructure/strawberry-shake-server-client It seems to be taking our absolute path, and treating it as if it should be relative to the project directory.

Steps to reproduce

  1. Create new dotnet project within a nested folder and add strawberry shake + schema/operations. (We used StrawberryShake.Server & StrawberryShake.Tool)
  2. Add a Directory.Build.props file to the root directory and specify an absolute path for the <BaseIntermediateOutputPath> property.
  3. Build project and observe the code generated relative to the project directory.

Relevant log output

No response

Additional Context?

No response

Product

Strawberry Shake

Version

13.0.0-preview.76

michaelstaib commented 2 years ago

Thanks for reporting!

AlexandraChibisov commented 2 years ago

Hi, I'd love to take a look at this one! Does anyone have any knowledge at which files/docs I should read up on to start out?

michaelstaib commented 2 years ago

@AlexandraChibisov this should be a simple one. I can walk you through in our zoom call.

michaelstaib commented 1 year ago

Fixed with #5770