graphql-engine
graphql-engine copied to clipboard
Support querying relationships of collections that contain arguments
Component
Graphql Engine
Is your proposal related to a problem?
Support querying collections that contain arguments via relationships.
For example, Consider an example Native Query top_artists:
SELECT *
FROM public."Artist"
ORDER BY "ArtistRank"
LIMIT {{top}}
I'd like to be able to write the following GraphQL query:
query {
Album {
Title
maybe_top_artist: top_artist(top: 10) {
Name
}
}
}
Describe the solution you'd like
Support for this feature in the engine.
Describe alternatives you've considered
Unfortunately, native queries do not fulfil our needs (our functions call other functions, and some are in plv8). We must be able to integrate postgres functions into the graph, with arguments and hasura varaibles, exactly as v2 works here (https://hasura.io/docs/latest/schema/postgres/computed-fields/).