Husqvik / GraphQlClientGenerator

GraphQL C# client generator
MIT License
213 stars 49 forks source link

Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). How to change type of IDs ? #117

Closed GautierT closed 1 year ago

GautierT commented 1 year ago

Hi,

In the graphql api that I'm using, IDs can be everything (string, numbers,...) but the generator consider that it's always Guid. So when it's not in a true guid I have errors : {"Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."}

Here you can see an exemple on the playground of the api

image

How can I change the type of IDs' so it's string or object and not Guid ?

Thanks a lot for this awesome lib !

GautierT commented 1 year ago

Okay, I found the solution in the code ! https://github.com/Husqvik/GraphQlClientGenerator/blob/44246753a1f3c194450d05fd94ec732143cd54be/src/GraphQlClientGenerator.Console/Commands.cs#L43

Thanks.