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

@tag Directive Not Generated in Import Array #7413

Open
stiew001 opened this issue Aug 28, 2024 · 0 comments · May be fixed by #7421
Open

@tag Directive Not Generated in Import Array #7413

stiew001 opened this issue Aug 28, 2024 · 0 comments · May be fixed by #7421
Assignees
Labels
🐛 bug Something isn't working 🌶️ hot chocolate

Comments

@stiew001
Copy link

stiew001 commented Aug 28, 2024

Product

Hot Chocolate

Version

13.9.7

Link to minimal reproduction

https://www.apollographql.com/docs/federation/federated-schemas/federated-directives/#importing-directives

Steps to reproduce

Assign tag to fields which needed to be used for contracts.
[Tag("beta")] public string Country { get; set; }

Generate schema from code.
var schema = await builder.Services .AddGraphQLServer() .UseField<FieldValidationMiddleware>() .ModifyRequestOptions(opt => opt.IncludeExceptionDetails = builder.Environment.IsDevelopment()) .AddApolloFederation() .AddQueryType<Query>() .AddMutationType<Mutation>() .AllowIntrospection(builder.Configuration.GetValue<bool>("AllowGraphQLIntrospection")) .BuildSchemaAsync();

In schema.graphql,
schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.5", import: [ "@key", "FieldSet", "@shareable" ]) { query: Query mutation: Mutation } where supposed to have @tag as well
schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.5", import: [ "@key", "FieldSet", "@shareable", "@tag" ]) { query: Query mutation: Mutation }

I can find this directive in schema
"The @tag directive is used to apply arbitrary string\nmetadata to a schema location. Custom tooling can use\nthis metadata during any step of the schema delivery flow,\nincluding composition, static analysis, and documentation.\n\ninterface Book {\n id: ID! @tag(name: \"your-value\")\n title: String!\n author: String!\n}" directive @tag(name: String!) repeatable on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
But we need the @tag in import for the Federation 2 tag works

What is expected?

The @tag directive should be generate in import string
schema @link(url: "https:\/\/specs.apollo.dev\/federation\/v2.5", import: [ "@key", "FieldSet", "@shareable", "@tag" ]) { query: Query mutation: Mutation }

What is actually happening?

Now it is not generating in import string and not working for Federation 2 tag function.

Relevant log output

No response

Additional context

No response

@stiew001 stiew001 added the 🐛 bug Something isn't working label Aug 28, 2024
@glen-84 glen-84 self-assigned this Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🌶️ hot chocolate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants