Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
TypeMappingException: Type io.leangen.graphql.spqr.spring.autoconfigure.DefaultGlobalContext is unbounded or missing generic type parameters #29
Hi I believe I found a bug, whenever the DefaultGlobalContext is injected without the type being specified for the request object a TypeMappingException is raised:
Here's an example to reproduce:
A workaround is to do:
graphql-spqr version 0.9.9
I thought about this some more, the issue is that if you are in the context of a subscription the DefaultGlobalContext's type would be WebSocketSession but if it's in the context of a query then you would get HttpServletRequest, which is why I am not providing the type (I'm pretty sure I saw an example @kaqqao provided somewhere without the type specified). Maybe a fix for this is to either relax the type checking thats going on or perhaps a bit better is to remove the generic typing from the DefaultGlobalContext and use turn the getNativeRequest into a generic method that will cast to whatever the specialized type should be?
I'll donate a PR for this if this approach sounds good @kaqqao ?