gateway icon indicating copy to clipboard operation
gateway copied to clipboard

Spread interfaces across service boundaries

Open AlecAivazis opened this issue 6 years ago • 1 comments

This issue should be the central place for discussion on federated interfaces.

Atm, I don't think there's a meaningful way to interpret two interfaces with conflicting definitions. The merger responds with an error when this is encountered.

If the definitions are the same, the merger allows for interfaces to show up in different services but the planner does not handle them very well. If there was an interface that spanned two services, the gateway will currently create a planner that always fire both queries regardless of wether the id belongs to the target service. Ideally, the planner could mark a step as optional depending on some predicate and not execute a step if it doesn't apply at query time.

{
    myInterface {              # <- serviceA
         ... on User {         # <- serviceB
              firstName
         }
         ... on NotUser {      # <- serviceC
              firstName
         }
    }
}

Related to #43

AlecAivazis avatar Feb 09 '19 00:02 AlecAivazis

The gateway has to be able to add id to the myInterface selection set which means that every boundary interface must be a superset of node.

AlecAivazis avatar Feb 09 '19 00:02 AlecAivazis