Replies: 3 comments 2 replies
-
The latest releases of DGS framework support federation 2 directives. I see you are using an older v5.4.1. Please try switching to a 7.x release. Also, I don't think you need the build.gradle setting, just the changes in your schema should suffice. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure in that case, especially if it's working in other repositories
(which is what I would expect). Perhaps you could compare the project set
up wrt dependencies that are getting pulled in and/or try it in a separate
simpler standalone project to see where things might be going wrong? Fyi,
the 2.7 branch is available but not actively maintained anymore btw, so it
would be better to switch sooner than later.
Hope this helps.
…On Wed, Oct 25, 2023 at 8:02 AM YousF9 ***@***.***> wrote:
Hey @srinivasankavitha <https://github.com/srinivasankavitha> - thank you
for the response. Unfortunately our organization hasn't upgraded beyond
Spring Boot 2.7 or JDK 17 and cannot do so in the near future. However,
other repositories and applications in our supergraph are successfully
opted into v2 with the above pinned versions. Does that make you think of
anything else that might be the issue?
—
Reply to this email directly, view it on GitHub
<#1681 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ5JPXKJKIXFKKPLWAV6XJDYBESXLAVCNFSM6AAAAAA6OOJKKSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TGOBSGUZTC>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hey @srinivasankavitha - it turns out the error was a bit of a red herring for future reference. The issue was as follows. In my schema, we had another defined schema type:
Adding the The resolution for us was to use |
Beta Was this translation helpful? Give feedback.
-
In an attempt to opt my subgraph into Federation v2, I am no longer able to gradleRun successfully:
2023-10-24 17:18:47.517 [ WARN] 3720 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dgsQueryExecutor' defined in class path resource [com/netflix/graphql/dgs/autoconfig/DgsAutoConfiguration.class]: Unsatisfied dependency expressed through method 'dgsQueryExecutor' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'schema' defined in class path resource [com/netflix/graphql/dgs/autoconfig/DgsAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [graphql.schema.GraphQLSchema]: Factory method 'schema' threw exception; nested exception is SchemaProblem{errors=['Job' [@564:1] use an unknown argument 'resolvable' on directive 'key'] use an unknown argument 'resolvable' on directive 'key'] use an unknown argument 'resolvable' on directive 'key', 'schema' [@16:1] tried to use an undeclared directive 'link']}
I cannot find any reason why DgsAutoConfiguration would suddenly fail as a result of these changes.
schema.graphqls
extend schema @link( url: "https://specs.apollo.dev/federation/v2.1", import: ["@key", "@shareable", "@provides", "@requires", "@external"])
build.gradle
oneGraph { federation { version = '2.0' importedDirectives = ['key', 'shareable', 'provides', 'requires', 'external'] } }
gradle.properties
kotlin_version=1.7.21 kotlinx_version=1.6.2 mockito_kotlin_version=2.2.0 netflix_dgs_codegen_version=5.6.0 netflix_dgs_framework_version=5.4.1
Any help would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions