ariadne-codegen
ariadne-codegen copied to clipboard
[feature request]. Cli args, new cli commands
First of all thank you for such an awesome library! When I researched your codegen functionality it's so clean and intuitive.
It'd be great to add cli args. What if you don't want to use pyproject.toml? Yes you can make a fork and do it yourself but you can have it out of the box.
And it'll be awesome if you want to add new methods from a different queries file to existing client. Just imagine the host is down and you have to wait until it's up and running again or write methods manually
PS:
-
There is typo https://github.com/mirumee/ariadne-codegen/blob/main/ariadne_codegen/generators/client.py#L41
-
I wanted to make a PR but no rights, so I'll let you know in the comment Wanted to change https://github.com/mirumee/ariadne-codegen/blob/main/ariadne_codegen/generators/client.py#L56 to https://gist.github.com/kuzmich321/d5f3a01a659771c5c64c804120009bf0
What do you mean by not having PR rights? I've checked repo's setup and we don't limit other people ability to open PRs in any way. We also got some PRs from other folk already. 🤔
It'd be great to add cli args.
Fine by me.
What if you don't want to use pyproject.toml?
IF you aren't using pyproject.toml, then what you are using?
And it'll be awesome if you want to add new methods from a different queries file to existing client. Just imagine the host is down and you have to wait until it's up and running again or write methods manually
I don't understand this part. You can have multiple queries files already. And if there's no way to access remote schema, there's no way for codegen to get types it needs to generate the client. Workaround for this is keeping local copy of remote schema. But it feels like separate feature request.
What do you mean by not having PR rights? I've checked repo's setup and we don't limit other people ability to open PRs in any way. We also got some PRs from other folk already.
My bad.
IF you aren't using pyproject.toml, then what you are using?
Well, it's nothing 😅
You can have multiple queries files already.
My bad again. Then I didn't test that and docs don't show you that you can
Workaround for this is keeping local copy of remote schema.
I think not everyone would keep it on local machine so...
My bad again. Then I didn't test that and docs don't show you that you can
Our docs say that queries path should be either file or directory with queries:
queries_path - path to file/directory with queries
I guess we could reword this to "path to .graphql
file or directory with files with queries" but I am not sure how much better that woudl be.
I think not everyone would keep it on local machine so...
...so what do you propose? You've described a problem (remote schema is down) but I don't see anywhere in your post any idea or proposition of solution for this problem? 🤔 Having local copy of schema is only thing that comes to mind for me there.
Glossing over the latter part of the discussion in this issue, we've decided that we can add support for passing options to codegen without use of pyproject.toml
.
So, what's the plan? Should all the options from TOML file be exposed as CLI args so it's possible to run ariadne-codegen
like this?
ariadne-codegen --schema_path=schema.graphql --queries_path=queries.graphql
Do you need any help with that? :)
Do you need any help with that? :)
PRs are very welcome :)
So, what's the plan? Should all the options from the TOML file be exposed as CLI args so it's possible to run
ariadne-codegen
like this?
Yes, all options from toml should be exposed as cli args. Keep in mind we already have exposed --config
arg. Also supported options are different for client and for graphqlschema
I'll see what I can do :) It'll mostly depend on the amount of free time I'm gonna have in the nearest time.