-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Allow using database functions as GraphQL selectors instead of just tables and views. #394
Comments
Hi @dosco, just checking in to see if there is a roadmap for this? |
Yes plan to work on it next week. working on another bug fix at the moment. |
Two new tests added to
|
A SQL function in Postgres can return this:
Reference https://www.postgresql.org/docs/current/sql-createfunction.html
EDIT: For our specific use case, we return a custom type in Postgres created using |
Can you provide an example of a query using a function that returns non record values for example one that returns a string or boolean. How do you use a function as a selector in your query? An example will be helpful. In GraphJin selectors are equal to tables they can have limit, where and other arguments. Open to evolving this I just need some examples beyond the link to the postgres doc on functions. |
Examples really help can you give me an example of this type of function (does it not return a type inherited from record) also an example GraphQL query using this will help. |
FYI Working on a fix |
Added support for functions with user-defined types |
does this work for you? please close this issue if it does. |
Every function can return a table, ref https://www.postgresql.org/docs/current/sql-createfunction.html
EDIT:
Some of our functions also return a boolean, or a set or other return types, as mentioned in https://www.postgresql.org/docs/current/xfunc-sql.html
Originally posted by @krish7919 in #312 (comment)
The text was updated successfully, but these errors were encountered: