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

GraphQL files with kebab cases generate incorrect F# code #43

Closed OkayX6 closed 3 years ago

OkayX6 commented 3 years ago

I had a file like this: image

And the generated FS code was this (picture from my Git DIFF, can you reason about it enough?) : image

Obviously they didn't compile, so I just escaped the identifiers.

Zaid-Ajaj commented 3 years ago

Hi @OkayX6, thanks for filing the issue! This should be a simple fix. As a workaround (without changing the file name) you can give queries or mutations names from within the query itself which will be the name of the function in the client and the corresponding modules. Instead of

query { }

write

query KanbanContent { }

Zaid-Ajaj commented 3 years ago

Snowflaqe v1.21 is released and it fixes this issue. Please give it a try and let me how it works for you 😉