graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

Support querying relationships of collections that contain arguments

Open soupi opened this issue 1 year ago • 1 comments

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

soupi avatar May 23 '24 07:05 soupi

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/).

LydiaF avatar May 24 '24 10:05 LydiaF