-
-
Notifications
You must be signed in to change notification settings - Fork 119
Create one file for each query when using wildcards on queries_glob #27
Comments
I thought that when you use |
Hey @danilolr, @amadeu01 However, since Say that you
I couldn't think in a way of defining multiple glob outputs from a glob input, so any feedback will be appreciated if you can think in a way we can solve this! Because, as I said, that's a limitation on how |
I'm gonna mark this as a possible enhancement to the library: to be able to have ouput globs again. |
Oh yeah, people already gave me the idea of namespacing each query, like in this example, where we have two queries with a common type (
In this example, two different classes would be generated: |
@comigor This is how the apollo-tooling codegen works. It seems like a good approach. Is this something that we can implement anytime soon? I'd like to ty artemis with a larger project, so I'd definitely like to avoid having to manually define each schema_mapping. |
This should already be implemented just by enabling
Could you test this approach and report back, please? |
@comigor oh, great! Yes, I'll test and let you know if I run into any issues. Thanks for the quick response! |
First of all, thank you for building this useful tool! I'm looking forward to have this implemented on this tool, my project would benefit a lot from this functionality. In the meantime I planned to use add_query_prefix to generate diferent prefixes and avoid the class name collision but I wasn't able to use it with all my queries whenever more than one query returned a graphql enum of the same type, however this setting worked fine with other queries that didn't return an enum of the same type. |
I have this on my build.yaml
When I run I received this error :
Exception: Two classes were generated with the same name
Usuario
!You may want to do either:
Enable add_query_prefix on this schema_map
Make queries_glob stricter, to gather less .graphql files on a single output
Use alias on one of the places a
Usuario
field is requestedOk. I understand what causes the issue.
What about create one file per query :
So it will create many files without the need to declare each query on build.yaml
The text was updated successfully, but these errors were encountered: