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

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

@clanie

Description

@clanie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions