Validate directive locations in subgraph implementations
Not sure the best way to test this but we just noticed that absinthe_federation did not have up-to-date locations defined on a few federation directives. Not sure if they were wrong from the beginning or if @apollo/subgraph updated its implementation but it would be nice to know when that happens and have this test suite notify subgraph maintainers of those types of changes. absinthe_federation PR to update directive definitions for reference https://github.com/DivvyPayHQ/absinthe_federation/pull/58
Hello 👋 I think that is a good idea but might be somewhat problematic to test.
We are comparing the expected schema against the SDL returned by the _service { sdl } query
- in federation v1 all the federated definitions should be stripped out of this SDL
- federation v2 relaxed the composition rules so the
_service { sdl }can simply return full SDL definition (including federated definitions, this is the preferred implementation right now) but it still works fine if definitions are excluded (for backwards compatibility) - with introduction of
@linkdirective, federated definitions can now be imported and don't have to be present within the SDL returned by_service { sdl }
So sadly not every implementation will contain those definitions as they don't have to be present in the _service { sdl }