-
Notifications
You must be signed in to change notification settings - Fork 329
Closed as not planned
Description
I faced a strange behavior. It might not be a bug, or it's something specific to my application but I figured it could help.
The query has 2 @SchemaMapping
one is public and the other is private. No reason just inconsistency on my side. When running the query locally it works fine, but when deployed in dev, the facets part throws a NPE because productService
is null. When switching the method from private to public it works.
JDK 21
SB 3.3.4
@Controller
public class ProductGraphQlController {
private final ProductService productService;
public ProductGraphQlController(ProductService productService) {
this.productService = productService;
}
@QueryMapping
public ProductSearch allProductsWithFacets(
@Argument String tenant,
ScrollSubrange subrange,
GraphQLContext graphQLContext
) {...}
@SchemaMapping(field = "content")
public Window<Product> content(
ProductSearch productSearch,
@ContextValue String tenant,
@ContextValue ScrollSubrange subrange
) {...}
@SchemaMapping(field = "facets")
private List<Facet> facets(
ProductSearch productSearch,
@ContextValue String tenant
) {...}
}
Metadata
Metadata
Assignees
Labels
No labels