Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jamesdh opened this issue May 31, 2024 · 0 comments

Comments

@jamesdh
Copy link

jamesdh commented May 31, 2024

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?

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

No branches or pull requests

1 participant