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

Allow disabling of subscription related functions in StrawberryShake #3759

Closed Alxandr closed 2 years ago

Alxandr commented 3 years ago

Is your feature request related to a problem? Please describe. I'm creating a library (nuget package) for calling our GraphQL server using strawberry shake. The server does not support websockets/subscriptions, so I would like to not have the Watch methods and similar generated (as it will likely lead to user-error).

Describe the solution you'd like A simple switch to disable subscription related code generation would probably suffice. Though, for some future-proofing it might be a good idea to make this an object instead of a simple yes/no bool, so that more granular toggles can be added in the future. Just spitballing, but maybe something like:

"subscriptions": {
  "enabled": false, // disable the whole feature
  // later
  "generateWatchMethods": false
}

Describe alternatives you've considered I don't know if there exists any good options. The only thing I can think of is creating 2 assemblies, and then IL-merging to hide the public APIs.

Additional context

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.