Preview Limitations of Apollo Connectors
Apollo Connectors has the following limitations while in preview.
Some supergraphs are unsupported
A small fraction of supergraphs will not compose when adding a connector. If you add a connector and see a number of unrelated errors after composing (usually related to SATISFIABILITY
), then you've likely encountered this limitation.
Abstract schema types are unsupported
Abstract schema types (interface
and union
) are currently not supported with in subgraphs that contain connectors.
Support for @interfaceObject
was added in preview.3.
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.
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}
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.
1type Query {
2 products: [Product] @override(from: "subgraph-b") # ⛔️
3}
1type Query {
2 products: [Product] @connect(...)
3}
The other direction is supported:
1type Query {
2 products: [Product]
3}
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
, andexecution
hooks still work as expected, but the connector equivalent to thesubgraph
hook is not yet available.