Handling schema publish with subscriptions (federation) #493
-
We've got a federated GraphQL, and one of the subgraphs contains subscriptions. As these can't be used with federation, we just allow traffic to go directly to this subgraph for subscriptions only. When it comes to publishing to Hive, it rejects the schema as it contains subscriptions. To get around this, we've moved our subscriptions into their own files, and excluded them. Something like the following: hive schema:publish "src/**/\!(subscription).graphql" --service app --url http://app Could anyone think of a better way to achieve this? Perhaps a CLI flag or something. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The Federation project in GraphQL Hive follows the rules of Federation spec (both validation and composability). If you want to compose N services into supergraph then you can't include a subgraph that is not composable with the rest of services. Nothing we can do here. If you use this subgraph as standalone GraphQL API then you should use a single schema project, for that graphql api, it's not part Federated GraphQL API anyway. |
Beta Was this translation helpful? Give feedback.
The Federation project in GraphQL Hive follows the rules of Federation spec (both validation and composability). If you want to compose N services into supergraph then you can't include a subgraph that is not composable with the rest of services. Nothing we can do here. If you use this subgraph as standalone GraphQL API then you should use a single schema project, for that graphql api, it's not part Federated GraphQL API anyway.