-
Notifications
You must be signed in to change notification settings - Fork 2.8k
console: show only compatible postgres functions in computed fields section (close #5155) #5978
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
Conversation
|
Beep boop! 🤖 Hey @GrizliK1988, thanks for your PR! One of my human friends will review this PR and get back to you as soon as possible. Stay awesome! 😎 |
11b2112 to
2f33c2c
Compare
beerose
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR!
Filtering out functions that don't accept table row argument works great!
However, we could go one step forward and handle a few more requirements mentioned here: https://hasura.io/docs/1.0/graphql/core/schema/computed-fields.html#supported-sql-functions.
Specifically, we could:
- Check for the
function_typeand accept only STABLE or IMMUTABLE - Check for the input arg types (we need 'b' — base or 'c' — composite)
| it('Moving to the table', passMTMoveToTable); | ||
| it('Creating functions', passMTCreateFunctions); | ||
| it('Modify table button opens the correct route', passMTCheckRoute); | ||
| it('See only functions for current table', passMTFunctionList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| it('See only functions for current table', passMTFunctionList); | |
| it('Can create comupted field with compatibile functions', passMTFunctionList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @beerose,
Thank you for your feedback! Described changes look good to me and I'll apply them in upcoming days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
Code is updated. VOLATILE functions and functions with unsupported arguments are now filtered out.
Thanks for your suggestions once again!
2f33c2c to
e6c6522
Compare
|
Deploy preview for hasura-docs ready! Built with commit 0fd2050 |
6e49f76 to
8a19794
Compare
60ebefb to
c177e1d
Compare
beerose
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you again for your PR and for taking time to add tests! 🎉
Approving console changes
beerose
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Console
|
Beep boop! 🤖 Awesome work @GrizliK1988! Your changes were merged successfully. All of us at Hasura ❤️ what you did. Thanks again 🤗 |
Show only compatible postgres functions in computed fields section
Description
When computed field is being created, user will see only functions that have table row as one of arguments
Changelog
CHANGELOG.mdis updated with user-facing content relevant to this PR. If no changelog is required, then add theno-changelog-requiredlabel.Affected components
Related Issues
#5155
Solution and Design
At the beginning I planned to adjust SQL query to fetch only needed functions like
Unfortunately backend doesn't accept json fields in where statements and I adjusted filtering on js side, which shouldn't be a problem, until user will have thousands of functions.
Steps to test and verify
There is a new test case in Cypress to verify functionality.