Closed Prabha1389 closed 3 months ago
Hello,
This could fail for lots of reasons. So it's difficult to give a valid answer here.
And this is more a spring boot question than a question about this plugin.
Did you check pages like this one: https://www.baeldung.com/spring-boot-add-filter ?
Étienne
I'm facing a problem where I could not inject access token retrieved in my context to the default WebClient bean of the GraphQL Client.
My application is a wrapper service which exposes a REST Service and it communicates to the backend GraphQL Server. At the server side the service is protected with OKTA OAUTH2.0, hence each request which I make should have a valid bearer token. At this moment the out of the box configuration provides all facility to generate a OAUTH token and call the backend server.
But, the trick here is in order to generate a OAUTH token successfully, I should retrieve the credentials (basically my REST service is exposed with Basic auth) and then add them to my token request to backend.
For instance, i would like to dynamically replace the value of "accessToken" here - https://github.com/Latsode/spring-graphql-shopify-client-sample/blob/master/src/main/java/com/client/shopify/graphql/util/ShopifyHeaderExchangeFilter.java
I tried creating my own Exchange filter but with no luck. Also, tried overwriting the GraphQlClient on MutationExecutor class etc..
My service is a spring-boot application built with Apache Camel. I use the service for Mutation with the Client code generated by by the plugin.
` @Bean(name = "webClient") public WebClient webClient(String graphqlEndpoint) { try { ExchangeStrategies exchangeStrategies = ExchangeStrategies.builder() .codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(-1)).build();