-
Notifications
You must be signed in to change notification settings - Fork 257
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
Directives defined in subgraph are not added in supergraph #1892
Comments
Hi there! Thanks for sending in the issue. We were literally in the process of writing it up in #1893 when you sent this in, I'm going to close this in favor of that, but please take a look and add comments on it (even if it's the body of this issue). Happy federating! |
Hii, @cpeacock @clenfest This issue seems to persist in latest version as well I am also using rover CLI to generate supergraph schema.
|
Hey @chandakakshat. Have you tried using the @composeDirective documentation found here? https://www.apollographql.com/docs/federation/federated-types/federated-directives/#composedirective If not, would you mind writing up an example explaining what the issue is? |
Hii, @clenfest @cpeacock Tried adding the directive as core feature using @link but the documentation of URL suggests a format for specifying URL in the @link directive Also, why do we need to provide directive specification using @link, when its already defined in the subgraph as follows
|
|
@chandakakshat it looks like you need to bump your federation version (package versions and spec versions in the SDL) to at least v2.1. Based on the snippet above, you also need to provide a Incorporating the changes I suggested should look like this: extend schema
@link(
url: "https://specs.apollo.dev/federation/v2.4"
import: ["@key", "@shareable", "@composeDirective"]
)
@link(
url: "https://myRelationDirectiveSpec.dev/v1.0"
import: ["@myDirective"]
)
@composeDirective(name: "@relation")
directive @relation(
direction: String = "OUT"
from: String = "from"
name: String
to: String = "to"
) on OBJECT | FIELD_DEFINITION |
Directives defined in subgraph schema are not included in supergraph schema.
subgraph schema
PERSON
:subgraph schema
MOVIE
:supergraph schema :
Here in supergraph schema directive
relation
is not getting added which is defined in subgraphPERSON
.Is there any configuration by which we can enable addition of directives, defined in subgraphs, to supergraph schema?
I am using
rover
CLI to generate supergraph schema.Dependencies:
The text was updated successfully, but these errors were encountered: