Feature add `compose` command
We should create a new compose command that allows us to compose configurations. This feature is already implemented via check command.
Usage for compose
Print the composed configuration on the terminal using a format
tailcall compose a.yml b.graphql c.json --format=YML
Improvements in check
Passing --blueprint should print the blueprint on the CLI.
tailcall check a.yml b.graphql c.json --blueprint
Additional Requirements
- Drop the
--outparameter fromcheck
/bounty 200
💎 $200 bounty created by tailcallhq
🙋 If you'd like to work on this issue, comment below to get assigned
👉 To claim this bounty, submit a pull request that includes the text /claim #782 somewhere in its body
📝 Before proceeding, please make sure you can receive payouts in your country
💵 Payment arrives in your account 2-5 days after the bounty is rewarded
💯 You keep 100% of the bounty award
🙏 Thank you for contributing to tailcallhq/tailcall!
🙋♂️ Join our discord channel if you need help.
Hey, may I work on this?
in queue if re-assigned
in queue
/attempt #782, in queue
@Shylock-Hg: The Tailcall Inc. team prefers to assign a single contributor to the issue rather than let anyone attempt it right away. We recommend waiting for a confirmation from a member before getting started.
@tusharmath Hey there, I have some questions:
- In what format should be the configuration displayed in the terminal? (when there is no out file)?
- If there is no out file, wouldn't be a good idea to add a parameter that specify the format of the composed config displayed?
- What is the difference between the blueprint and the config? I can see that there is a function
display_schemathat prints only the schema from the blueprint, but I am not sure that is what it should output.
@adelinaenache Good questions
In what format should be the configuration displayed in the terminal? (when there is no out file)?
Default should be "pretty" json. But user should be able to customize it via the --format.
If there is no out file, wouldn't be a good idea to add a parameter that specify the format of the composed config displayed?
Yes. We can add a --format option.
What is the difference between the blueprint and the config? I can see that there is a function display_schema that prints only the schema from the blueprint, but I am not sure that is what it should output.
Config is what is inputted by the user. It validated and converted into a blueprint. The blueprint is like config, but stricter. If we have a blueprint we can be sure that a graphql server can be built using it, however we can't guarantee the same using a Config.
Config is what is inputted by the user. It validated and converted into a blueprint. The blueprint is like config, but stricter. If we have a blueprint we can be sure that a graphql server can be built using it, however we can't guarantee the same using a Config.
Ok so I'm trying to figure out what should I output when --blueprint is used vs when it's not used. Until now, I get that I should use the Config class to output normal configuration and the generated Blueprint class when using --blueprint.
So, what am I getting until now is:
- For normal configuration (without --blueprint option), shouldn't be any validity check in place? (just read from files and do not convert it into a blueprint, output the config just like with
check) - With
--blueprintoption, should I add some additional code on theBlueprintthat converts it to either YML or json and use that to write to file? - Why we disallow writing GQL schemas with
--blueprint? (@tusharmath)
For normal configuration (without --blueprint option), shouldn't be any validity check in place? (just read from files and do not convert it into a blueprint, output the config just like with check)
Yes we should just compose them together without validating.
With --blueprint option, should I add some additional code on the Blueprint that converts it to either YML or json and use that to write to file?
You can use serde and serde_yml to do this.
Why we disallow writing GQL schemas with --blueprint?
I am not sure what you mean by this question.
@adelinaenache Let me know if you are still on this or if I should reassign.
@tusharmath still on this
@tusharmath I want to work on this one can you assign this to me?
💡 @adelinaenache submitted a pull request that claims the bounty. You can visit your bounty board to reward.
🎉🎈 @adelinaenache has been awarded $200! 🎈🎊