Zaid-Ajaj / Snowflaqe

A dotnet CLI to generate type-safe GraphQL clients for F# and Fable with automatic deserialization, static query verification and type checking
MIT License
154 stars 25 forks source link

Tags is not a valid name for a DU case #61

Closed l3m closed 2 years ago

l3m commented 2 years ago

The F# compiler does not allow a union case called Tags as it's a member used internally. Aa related issue with some discussion can be found here

Snowflaqe generates a Tags DU member if the GraphQL endpoint has a corresponding name (I stumbled upon it for the monday.com api).

This will cause Snowflaqe to generate a project that cannot be compiled.

A work around is to rename the generated member, but this has to be done after every project regeneration.

Zaid-Ajaj commented 2 years ago

Hi @l3m, thanks for filing the issue. Fixed as of Snowflaqe v1.33 :rocket: Now generated case name is TAGS but the compiled name stays Tags so the runtime will keep working. I guess this is a rare edge case so TAGS isn't too bad to work with, I hope 🙏