Graphql-engine: support for relations with remote schemas

Created on 17 Dec 2018  路  9Comments  路  Source: hasura/graphql-engine

It would be nice to provide relations functionality for between local and remote schemas.

console server high

Most helpful comment

@Oleg2tor @revskill10 @Dorkside @marcsasson

Happy to announce that this feature is almost near completion and expect it in the next one or two releases.

All 9 comments

This is definitely something we'd like to work towards!
Can you give us a few examples of use-cases you'd like to power with this? Preferably a use-case you're currently facing.

The hard part is managing N+1 queries between remote schemas when stitching.
If we could solve that part, i think it's possible to stitch schemas in Hasura.

Also interested in this possibility. Any updates ?

We are facing a similar situation. @coco98 our use case is we have multiple micro services that reference each other by ids.
An example would be a transactions micro service having references to products that live in a separate micro service

@Oleg2tor @revskill10 @Dorkside @marcsasson

Happy to announce that this feature is almost near completion and expect it in the next one or two releases.

We urgently need this feature.
Any chance for a release within the next weeks?

@OlmoDalco Yes absolutely. If you want to try it out today, you can pick up the preview build from https://github.com/hasura/graphql-engine/pull/2395 i.e. try the docker image: hasura/graphql-engine:pull2395-20d1161b

Since the work on this is on fire right now, wanted to point out,
that it would be nice to have a multi join, where hasura would make only one call to the remote schema if certain conditions are met.

For example, if my posts are in hasura and likes somewhere else, and I am loading many posts with likes

query {
  posts {
    title
    likes {
      count
    }
  }
}

As I understand, this would result in N-Queries to the likes remote schema which accepts only one post_id. My proposal is to allow to batch this likes query with multiple post_ids if there is such a field. (Maybe a separate configuration option)

Was this page helpful?
0 / 5 - 0 ratings