Skip to content

Directives do not get reported through _service.sdl introspection query ---> subgraph cannot be federated #736

Open
@magicmark

Description

@magicmark

Apollo federation uses the following introspection query when glueing together subgraphs:
https://github.com/apollographql/rover/blob/83d99ad2c707a5da4e3d48593af7b22a51d6d07d/crates/rover-client/src/operations/subgraph/introspect/introspect_query.graphql#L1-L6

query SubgraphIntrospectQuery {
    # eslint-disable-next-line
    _service {
        sdl
    }
}

In our subgraph, we define a schema only, non-executable @lint directive. If I do an introspection for directives directly, it shows up, with all the other directives:

Screen Shot 2021-12-03 at 11 10 13 PM

But if I run the introspection query apollo rover is using (@apollo/[email protected]):

Screen Shot 2021-12-03 at 11 09 37 PM

^ That's just some random test schema, but cruicially - no directives in the output.

This ultimately leads to the following:

error[E029]: Encountered 1 build error while trying to build a supergraph.

Caused by:
    Encountered 1 build error while trying to build the supergraph.
    UNKNOWN: [@lint] -> Custom directives must be implemented in every service. The following services do not implement the @lint directive: i18n_strings.

I'll keep poking around, it's possible i'm missing a trick here somewhere, or need to upgrade things, but writing this down as a starting point. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions