LazyInitializationException with graphql-spring
LazyInitializationException with graphql-spring I am currently in the middle of migrating my REST-Server to GraphQL (at least partly). Most of the work is done, but i stumbled upon this problem which i seem to be unable to solve: OneToMany relationships in a graphql query, with FetchType.LAZY. I am using: https://github.com/graphql-java/graphql-spring-boot and https://github.com/graphql-java/graphql-java-tools for the integration. Here is an example: Entities: @Entity class Show { private Long id; private String name; @OneToMany private List<Competition> competition; } @Entity class Competition { private Long id; private String name; } Schema: type Show { id: ID! name: String! competitions: [Competition] } type Competition { id: ID! name: String } extend type Query { shows : [Show] } Resolver: @Component public class ShowResolver implements GraphQLQueryResolver { @Autowired private ShowRepository showRepository; public List...