Graphql-engine: namespace remote schemas or conflict resolution with remote types/fields

Created on 11 Dec 2019  路  9Comments  路  Source: hasura/graphql-engine

Should we ask for an optional namespace input from the user while adding Remote Schemas and then every type and field in the RS is prefixed with this namespace.

This would allow using Remote Schemas with generic fields like user.

remote-schemas

Most helpful comment

Upvote namespacing of remote schemas. Makes linking staging and production instances way easier.

All 9 comments

This would be definitely a great feature! I'm just having a situation where two of my remote schemas both a provide a query operation "list" and these, of course, clash in Hasura.

And even if names do not clash, remote schema operation names are somehow "polluting" the Hasura schema and it would be better to have a definite name to appear for them in the schema to more easily identify which operations belong to a remote schema and which are native Hasura operations.

@tirumaraiselvan Do you have an estimate when such namespacing could be available?

Upvote namespacing of remote schemas. Makes linking staging and production instances way easier.

Another way is to nest remote schemas inside a namespaced field like

query {
  remote_schema1 {
    hello
  }
}

Originally posted by @samuelcastro here: https://github.com/hasura/graphql-engine/issues/4809

Yes, as @tirumaraiselvan mentioned I think grouping schemas by namespace would be more manageable and/or readable, I don't like the idea of prefixed names.

Is there any work in progress around this or this is still in a discussion phase?

I think this is a critical issue, I'm using different graphql services providers and I'm starting to get worried about this conflicting problem.

Thanks.

We have an RFC here: https://github.com/hasura/graphql-engine/pull/4821

We will begin the implementation very soon.

Could creating a proxy server that takes a GraphQL schema, adds a prefix to all queries and mutations and forwards incoming calls to the remote schema be a feasible workaround? Or is it more involved as all the type definitions would have to be changed as well?

Hi @tirumaraiselvan,

Any updates on this? We are facing this issue with trying to use Remote Joins at the moment.

We have many services internally exposing a GraphQL API, all aggregated under one instance of Hasura ("master" Hasura) using Remote Schemas, for public consumption. We want to use Remote Joins in some of those services.

So for ex., Service A, B and C are all publicly exposed in our "master" Hasura via Remote Schemas. Now, Service A will use Remote Joins to Service B, so it will add Service B as a Remote Schema. However, in "master" Hasura, we cannot use Service A as a Remote Schema anymore because "master" Hasura is already using Service B as a Remote Schema.

Please let me know. Thanks!

Closing this in favour of #5863

Was this page helpful?
0 / 5 - 0 ratings

Related issues

codepunkt picture codepunkt  路  3Comments

sachaarbonel picture sachaarbonel  路  3Comments

cpursley picture cpursley  路  3Comments

hooopo picture hooopo  路  3Comments

bogdansoare picture bogdansoare  路  3Comments