Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate directive locations in subgraph implementations #145

Open
kdawgwilk opened this issue Aug 2, 2022 · 1 comment
Open

Validate directive locations in subgraph implementations #145

kdawgwilk opened this issue Aug 2, 2022 · 1 comment
Labels
type: enhancement New feature or request

Comments

@kdawgwilk
Copy link
Contributor

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 DivvyPayHQ/absinthe_federation#58

@dariuszkuc
Copy link
Member

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 @link directive, 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 }

@dariuszkuc dariuszkuc added the type: enhancement New feature or request label Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants