Limitations of Apollo Connectors
Apollo Connectors have the following limitations.
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 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.
Unsupported federation directives
The following Apollo Federation directives are unsupported or partially supported.
@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}Interactions with GraphOS Router features
The following GraphOS Router features are not yet supported with Connectors:
Entity caching
Rhai scripting & coprocessors
Extensibility for Connectors is on the roadmap. The
router,supergraph, andexecutionhooks still work as expected, but the Connector equivalent to thesubgraphhook is not yet available.