-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add @validate directive for custom scalar validation #1847
Labels
Comments
/bounty 100 |
💎 $100 bounty • Tailcall Inc.Steps to solve:
🙏 Thank you for contributing to tailcallhq/tailcall!
|
tusharmath
changed the title
[Draft] Feat: Add @validate directive for custom scalar validation
feat: Add @validate directive for custom scalar validation
May 4, 2024
/attempt
|
@webbdays: Reminder that in 1 days the bounty will become up for grabs, so please submit a pull request before then 🙏 |
The bounty is up for grabs! Everyone is welcome to |
/attempt #1847
|
6 tasks
@mobley-trent |
Feel free to pick up the issue @webbdays |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description:
Currently, Tailcall allows developers to define custom scalars. However, there's no built-in way to add validations on those custom scalars. I propose creating a
@validate
directive which takes js function as input and can be applied on scalars. The js function inside@validate
should return eithertrue
orfalse
. If it returnsfalse
, the user should receive a Evaluation error when an invalid value is passed into the scalar.Expected Behavior:
@validate
directive should be applicable to custom scalar types.true
for valid values andfalse
for invalid values.false
, a Evaluation error should be thrown to indicate the issue to the user.Tasks:
@validate
directive that developers can use on custom scalars.Example
The text was updated successfully, but these errors were encountered: