Preview Limitations of Apollo Connectors


Preview
Apollo Connectors are currently in public preview. To get started, you need an Apollo account with a GraphOS Trial or Enterprise plan.

Apollo Connectors has the following limitations while in preview.

Abstract schema types are unsupported

Abstract schema types (interface, union, and the @interfaceObject directive) are currently not supported with in subgraphs that contain connectors.

A workaround for union types is to create a new type that combines all the properties from each possible return type and mark any non-overlapping fields as nullable.

GraphQL
Unsupported schema with abstract type
1type Query {
2  products: [Product]
3    @connect(
4      http: { GET: "/products" }
5      selection: """
6      $.results {
7        id
8        title
9        author { name }
10        director { name }
11      }
12      """
13    )
14}
15
16union Product = Book | Film
17
18type Book {
19  id: ID!
20  title: String
21  author: Person!
22}
23
24type Film {
25  id: ID!
26  title: String
27  director: Person!
28}
29
30type Person {
31  id: ID
32  name: String
33}
GraphQL
Workaround without abstract types
1type Query {
2  products: [Product]
3    @connect(
4      http: { GET: "https://api.example.com/products" }
5      selection: """
6      $.results {
7        id
8        title
9        author { name }
10        director { name }
11      }
12      """
13    )
14}
15
16type Product {
17  id: ID!
18  title: String!
19  author: Person # nullable
20  director: Person # nullable
21}
22
23type Person {
24  id: ID
25  name: String
26}

Circular references are unsupported

Connectors don't yet support circular references in GraphQL schemas. See troubleshooting for details.

Subscriptions are unsupported

Currently, you can use @connect on fields of the Query and Mutation types, but not on fields of the Subscription type.

@context and @fromContext are unsupported

Support is on the roadmap.

@override is partially unsupported

It's not currently possible to override fields in a subgraph with connectors.

GraphQL
subgraph-a (resolver-backed)
1type Query {
2  products: [Product] @override(from: "subgraph-b") # ⛔️
3}
GraphQL
subgraph-b (with connectors)
1type Query {
2  products: [Product] @connect(...)
3}

The other direction is supported:

GraphQL
subgraph-a (resolver-backed)
1type Query {
2  products: [Product]
3}
GraphQL
subgraph-b (with connectors)
1type Query {
2  products: [Product]
3    @override(from: "subgraph-a") # ✅
4    @connect(...)
5}

Inconsistent query plan diagrams

The query plan diagrams for subgraphs with connectors are inconsistent across Apollo tools.

The GraphOS Router's sandbox shows an accurate query plan, but other presentations of a query plan diagram are incomplete. GraphOS Explorer and operation insights show only the subgraphs and without visibility into HTTP calls.

Interactions with GraphOS Router features

The following GraphOS Router features are not yet supported with connectors:

  • HTTP Traffic shaping

  • Demand control

  • Entity caching

  • Rhai scripting & coprocessors

    Extensibility for connectors is on the roadmap. The router, supergraph, and execution hooks still work as expected, but the connector equivalent to the subgraph hook is not yet available.

Feedback

Forums