apollographql / federation-next

Moved to the Router repository
https://github.com/apollographql/router/tree/dev/apollo-federation
Other
19 stars 1 forks source link

Add @defer definition to unit tests that need it #213

Closed SimonSapin closed 6 months ago

SimonSapin commented 6 months ago

This and three other unit tests are currently #[ignore]d because they use defer and (I assume) fail because the directive is not defined: https://github.com/apollographql/federation-next/blob/173b40b9c4ce50319727d8ebd4e9dc200f848aff/src/query_plan/operation.rs#L2372-L2374

Normally it’s to_api_schema() that adds the definition if defer is enabled in configuration. But since these tests use a hard-coded schema not going through to_api_schema, they should explicitly include the definition:

directive @defer(label: String, if: Boolean! = true) on FRAGMENT_SPREAD | INLINE_FRAGMENT