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

Add support for tag spec v0.3 #2314

Merged
merged 6 commits into from
Jan 5, 2023

Conversation

sachindshinde
Copy link
Contributor

This PR:

  • Adds a tag spec definition for tag spec v0.3.
    • The only change is to add support for the SCHEMA location in the @tag directive definition.
    • This also changes composition to use tag spec v0.3 in output.
  • Updates SUPPORTED_FEATURES to include tag v0.3 (which controls supported features during supergraph schema processing).
  • Updates the federation spec to use the @tag directive definition of tag spec v0.3.
    • Note this change only uses that directive definition for federation spec v2.3.
    • For federation spec v2.2 and below, we maintain current behavior (which is to use the @tag directive definition of tag spec v0.2).
      • This is arguably a bug, as we should be using the @tag directive definition of tag spec v0.1 for Fed 1 instead of v0.2, but I'm guessing it's benign given no one's complained thus far (and we'd have to run checks if we wanted to change the behavior).
  • Updates TagDirective in @apollo/subgraph to use the @tag directive definition of tag spec v0.3.
  • Updates tests.

@netlify
Copy link

netlify bot commented Jan 4, 2023

👷 Deploy request for apollo-federation-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 7b88b70

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 4, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Contributor

@pcmanus pcmanus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm. Can you push some changelog entries (in subgraphs-js/CHANGELOG.md and gateway-js/CHANGELOG.md ideally)?

…ich declares the latest version of the tag definition for subgraphs, but isn't really used by our code)
…e where it was mistakenly using tag v0.2 spec for Fed 1, but going to keep old behavior until we run more tests
@sachindshinde
Copy link
Contributor Author

@pcmanus
Sounds good, updated the CHANGELOG.md for subgraph-js and gateway-js (also updated the CHANGELOG.md for composition-js). Will merge into main, let me know if there's anything in the CHANGELOG.md entries I should tweak and I can file follow-up PRs.

@sachindshinde sachindshinde merged commit 6474916 into apollographql:main Jan 5, 2023
@geekmini
Copy link

Hi all, I've upgrade form @apollo/subgraph from 2.2.3 to 2.3.1 but found this errors on tags.

"@tag" should have locations field_definition, object, interface, union, argument_definition, scalar, enum, 
enum_value, input_object, input_field_definition, but found (non-subset) field_definition, 
object, interface, union, argument_definition, scalar, enum, enum_value, input_object, 
input_field_definition, schema

It seems this change will breaking existing directives. Is there any guid for migration without breakage that we the community could have a reference to ?

@sachindshinde
Copy link
Contributor Author

@geekmini Thanks for writing in! Your error looks similar to that reported in #2375 . We've written up some guidance in #2375 (comment) , can you let us know whether that resolves the issue?

@GeekEast
Copy link

Hi @sachindshinde yup, upgrade the federation version solves the issue. BTW, I am using Nest.Js as framwork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants