Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

@connection not working after Spring Boot and graphql upgrade #935

Open
clanie opened this issue Apr 5, 2023 · 1 comment
Open

@connection not working after Spring Boot and graphql upgrade #935

clanie opened this issue Apr 5, 2023 · 1 comment
Labels

Comments

@clanie
Copy link

clanie commented Apr 5, 2023

After upgrading to version 15 and Spring Boot 3.0.5 (from Spring Boot 2.7 and graphql-spring-boot-starter 11.0.0) our application fails to start, throwing this exception:

Caused by: graphql.schema.validation.InvalidSchemaException: invalid schema:
A definition for directive 'connection' could not be found
    at graphql.schema.GraphQLSchema$Builder.validateSchema(GraphQLSchema.java:935)
    at graphql.schema.GraphQLSchema$Builder.buildImpl(GraphQLSchema.java:929)
    at graphql.schema.GraphQLSchema$Builder.build(GraphQLSchema.java:894)
    at graphql.kickstart.tools.SchemaObjects.toSchema(SchemaObjects.kt:29)
    at graphql.kickstart.tools.SchemaParser.makeExecutableSchema(SchemaParser.kt:111)
    at graphql.kickstart.autoconfigure.tools.GraphQLJavaToolsAutoConfiguration.graphQLSchema(GraphQLJavaToolsAutoConfiguration.java:147)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    at java.base/java.lang.reflect.Method.invoke(Method.java:578)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:139)
    ... 124 common frames omitted

We have a lot of queries defined similar to this:

customers(orgId: UUID!, cursor: String, pageSize: Int, sort: String, filter: CustomerFilter): CustomerConnection @connection(for: "Customer")

and it obviously has something to do with the @connection directive in that, but I can't for the life of me figure out why it no longer understands that.

According to https://www.graphql-java-kickstart.com/tools/relay/ it should be handled by RelayConnectionFactory, which should be enabled by default.

@clanie clanie added the bug label Apr 5, 2023
@nick-evocalize
Copy link

Also ran into this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants