apollographql / federation-jvm

JVM support for Apollo Federation

Home Page:https://www.apollographql.com/docs/federation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@inaccessible directives no longer returned in _service { sld } query, after release 0.7.0

manymotes opened this issue · comments

@inaccessible directives no longer returned in _service { sld } query, after release 0.7.0.

Im trying to leverage @inaccesible in some new sub graphs and I no longer get @inaccessible directives in the response from the subgraph query("_service { sdl }"). It is working in some of our older graphs which have release 0.7.0. I then rolled back the new graphs(which were on version 2.1.1) to release 0.7.0. The the older release, I started to get the directive in the subgraph query as I was hoping to.

To test things further, I bumped up to release: 0.8.0 and the subgraph query had the error of not returning @inaccessible directive. I looked at the code changes, and I was not able to clearly see what the change was, but I do believe the 0.8.0 release code changes is where the problem is at.

Hello 👋

v0.7.0 is a very old (Sept '21*) release that does not support Federation v2 features (including @inaccessible). v.0.8.0 added support for @CacheControl directive instrumentation and I don't see any other functional changes.

Federation v2 support was added in v2.0.0 published in May '22. Can you provide a link to a sample project that reproduces this issue?

--
*Github releases show all <= v2.0.0 versions as published in May '22 as that is when I created corresponding missing Github releases. You can see actual publish dates in Maven Central.

@dariuszkuc Ty for the quick response. I will work on getting a test repo up.

https://github.com/manymotes/inaccessible-test

Above is a test repo. Lmk if you have any question, or if i messed something up.

Thanks

In order to use Federation v2 directives you have to explicitly opt-in by applying @link directive with appropriate federation spec version, i.e. your test project schema should contain

extend schema
  @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@inaccessible"])

Import array should contain the names of all the imported directives and your schema should not be redefining any of the federated directive definitions.

Note that in order to use newer federation features you have to use federation-jvm version that supports it (e.g. latest federation spec is v2.3 and is supported by federation-jvm v2.3.1).

Ah, I see. Ty for explaining this, and for the quick responses!