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:
@context@fromContext
Partially supported federation directives
The @override directive is supported with some limitations.
@override is supported for fields transitioning from subgraphs that use resolvers to subgraphs that use Connectors.
1type Query {
2 products: [Product]
3}1type Query {
2 products: [Product]
3 @override(from: "subgraph-with-resolvers") # ✅
4 @connect(...)
5}@override is not supported for fields transitioning from subgraphs that use Connectors to subgraphs that use resolvers.
1type Query {
2 products: [Product] @override(from: "subgraph-with-connectors") # ❌
3}1type Query {
2 products: [Product] @connect(...)
3}Interactions with GraphOS Router features
The following GraphOS Router features are not yet supported with Connectors:
Entity caching
Rhai scripting and coprocessors. The
router,supergraph, andexecutionhooks work as expected, but Connectors don't have an equivalent to thesubgraphhook.