tailcall
tailcall copied to clipboard
bug: allow default values for input arguments.
Prerequisites
- [ ] I have checked the existing issues to ensure this is not a duplicate.
- [ ] I am running the latest version of Tailcall.
Describe the bug
currently the default values passed to input arguments are not used to query the data.
Expected behavior
- In following example, we pass 1 as default value to id.
type Query {
user(id: Int = 1): User @http(path: "/users/{{.args.id}}")
}
- when we make request from playground with following query then default id should be taken into account and request with default id should be made.
# client(playground) side query.
query {
user {
name
}
}
request made to upstream : http://jsonplaceholder.typicode.com/users/1
Actual behavior
- In following example, we pass 1 as default value to id.
type Query {
user(id: Int = 1): User @http(path: "/users/{{.args.id}}")
}
- but when we make request from playground with following query then default id is not taken into account and request without id is made.
# client(playground) side query.
query {
user {
name
}
}
request made to upstream : http://jsonplaceholder.typicode.com/users/
/bounty 100$
💎 $100 bounty • Tailcall Inc.
Steps to solve:
-
Start working: Comment
/attempt #1931
with your implementation plan -
Submit work: Create a pull request including
/claim #1931
in the PR body to claim the bounty - Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts
🙏 Thank you for contributing to tailcallhq/tailcall! 🧐 Checkout our guidelines before you get started. 💵 More about our bounty program.
Attempt | Started (GMT+0) | Solution |
---|---|---|
🟢 @ssddOnTop | May 13, 2024, 1:39:44 PM | WIP |
This is a simple fix. We need a way to specify default arguments in config. Store them in the blueprint, and then eventually while creating schema, copy them there.
/attempt
Algora profile | Completed bounties | Tech | Active attempts | Options |
---|---|---|---|---|
@ssddOnTop | 43 tailcallhq bounties | Rust, Java, C & more |
Cancel attempt |
💡 @ssddOnTop submitted a pull request that claims the bounty. You can visit your bounty board to reward.
there is an issue with async-graphql as well, I raised a PR https://github.com/async-graphql/async-graphql/pull/1527 there if it gets merged, I'll finish touchups for this issue.
/tip $100 @ssddOnTop