Skip to content

@GraphQLApi annotated Spring Data Repository results in error creating GraphQLSchemaGenerator bean on startup #149

@jamesdh

Description

@jamesdh

When trying to annotate a Spring Data Repository interface w/ @GraphQLAPI, e.g...

@RepositoryRestResource
@GraphQLApi
public interface ZipCodeInfoRepository extends JpaRepository<ZipCodeInfo, String>, QuerydslPredicateExecutor<ZipCodeInfo>, QuerydslBinderCustomizer<QZipCodeInfo> {

    @GraphQLQuery(name = "zipcodeInfo")
    default Optional<ZipCodeInfo> zipcodeInfo(@GraphQLArgument(name="zip") @NonNull String zip) {
        return findById(zip);
    }
}

...we get the following:

Factory method 'graphQLSchemaGenerator' threw exception with message: The registered object is of generic type org.springframework.data.jpa.repository.support.SimpleJpaRepository. Provide the full type explicitly when registering the bean. For details and solutions see https://github.com/leangen/graphql-spqr/wiki/Errors#generic-top-level-singletons

I don't see a way w/ the spring-boot-starter to add operations to the GraphQLSchemaGenerator. This seems like a pretty straightforward use case, so I feel like I must be missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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