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

Find graphql files under queries path recursively #83

Open etareduction opened 1 year ago

etareduction commented 1 year ago

So we can organize queries in folders like query and mutation

Zaid-Ajaj commented 1 year ago

The generated F# query and mutation files are created one-to-one from the GraphQL query files in a flat manner. If I add something like this, there is a chance that file names can collide when there are queries with the same name in different sub-directories.

I am leaning more towards keeping things simple as they are right now and if you need better namespacing, maybe consider adding a suffix or prefix to your query document names i.e. Query_Search.gql, Mutation_UpdateUser.gql etc.

Not the prettiest but should work well in IDEs when you start typing Mutation... or Query...

etareduction commented 1 year ago

@Zaid-Ajaj Would placing generated types for different subdirectories in separate dotnet namespaces help with that, or is it too much effort in current implementation?

Zaid-Ajaj commented 1 year ago

I think that complicates things a lot 😞 would rather keep the file structure as is right now. It is also possible to generate multiple projects from the same schema having different queries or mutations in each project.