How to GraphQL in Java

karthikeya

Hi Mike, I think the Interceptor is not registered with InterceptorRegistry. By registering our interceptor we can add lookup to a certain endpoints by specifying them in path patterns, as in our case it is “/graphql”. You should be implementing Spring WebMvcConfigurer for registering Interceptor.

InterceptorRegistryReference.addInterceptor(new CustomInterceptor()).addPathPatterns("/graphql");

I hope this helps and do let me know in more detail if above configuration does’nt work. Thank you!