Tag: Spring Boot
-
Postman giving 401 Unauthorized upon adding graphql-java-client dependency in spring boot
-1 I am working on a spring boot project with gradle that calls an external graphQL service using GraphQLHTTP Client. For this, I imported the following dependency in my build.gradle: implementation group: ‘com.graphql-java-generator’, name: ‘graphql-java-client-dependencies’, version: ‘2.3.1’ However, when I try to hit any endpoint (API) upon addition of above dependency, I am getting 401…
-
Can not acces backend in graphql spring boot application
0 Im working on a simple coding challenge that needs to createe a graphql application and save some objects (team,players,competitions and coach). I´ve never used graphql before so iim relying on sove tutorials on the web like: https://www.bezkoder.com/spring-boot-graphql-mysql-jpa/ and https://medium.com/@memredemir/creating-a-graphql-mysql-and-spring-boot-backend-service-32cec95f4436. For some reason i cant acces the backend for debug: This is my schema wiith…
-
GraphQL with Spring Boot Security returning 403
0 I have been trying to implement GraphAPI methods authorization. But, always get 403. Environment: JDK 17 Spring Boot 3.1.5 MongoDB Spring Security Graph QL OS: MacOS JDK 17 My application file looks like: import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration; import org.springframework.context.annotation.EnableAspectJAutoProxy; @SpringBootApplication(exclude = {SecurityAutoConfiguration.class, UserDetailsServiceAutoConfiguration.class}) @EnableAspectJAutoProxy public class JoblobApplication { public static…
-
com.netflix.graphql.dgs:graphql-dgs-client version compatibility with spring boot 3.x
0 I am currently using com.netflix.graphql.dgs:graphql-dgs-client version 4.9.15. This worked well with spring boot 2.6.6. On upgrading to spring boot 3.x specifically 3.1.3 I am seeing few failures (If required I can add more details about this). So I upgraded dgs client – com.netflix.graphql.dgs:graphql-dgs-client to 7.6.0. After upgrade, few things are working but other things…
-
Spring Boot Starter GraphQL LazyInitializationException
0 I am currently implementing GraphQL into a system and am using Spring Boot 3.0.5 together with org.springframework.boot:spring-boot-starter-graphql to implement GraphQL schemas and queries. However there is a query that has issues. The relevant JPA entities: @Entity public class Video { @Id @Column(length = 24, nullable = false) private String videoId; @ManyToMany(mappedBy = "video") private…
-
How to get TraceId and SpanID from OTEL Tracing
0 I am using SpringBoot and Graphql for a module as well using OTEL. I need spanID and traceID in the logs of the application. trace_id: OTel trace trace id, must be present in every log record produced in request context. span_id: OTel trace span id, must be present in every log record produced in…
-
Problem with spring boot graphql. Request /graphql results with 404
8 I’m trying to run simplest graphql example. I created application with spring initializer and only added graphql dependencies. My build.gradle buildscript { ext { springBootVersion = ‘2.1.1.RELEASE’ } repositories { mavenCentral() } dependencies { classpath(“org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}”) } } apply plugin: ‘java’ apply plugin: ‘eclipse’ apply plugin: ‘org.springframework.boot’ apply plugin: ‘io.spring.dependency-management’ group = ‘com.example’ version =…
-
Handling Exceptions not working with SPQR (graphql)
0 I am having an issue in configuring exception handling with this. I went through all the issues/examples and found some solutions. But don’t know that is not working. See, here is how I configured my graphQL @Autowired public GraphqlController(BookResolver bookResolver) { GraphQLSchema schema = new GraphQLSchemaGenerator() .withBasePackages("com.graphql.learn") .withOperationsFromSingleton(bookResolver) .generate(); this.graphQL = new GraphQL.Builder(schema) .queryExecutionStrategy(new…
-
Changing Default Welcome Screen of GraphiQL
0 I am working on documenting my graphQL endpoints so that they show on the GraphiQL IDE. I am using the springboot spring-boot-starter-graphql, version 3.1.1 package which includes graphiQL. So far I have been using comments in my graphql schema files so that they generate in the docs section. The part I am stuck on…
-
Spring for GraphQL: addressing over- and under- fetching by changing schema structure?
0 I’m using Spring for GraphQL and having trouble understanding how to make my graphql resolvers avoid over- and under- fetching without modifying my schema to reflect how data is grouped in my database. I’ve read about the N+1 problem but I think this is slightly different. Consider the following graphql schema: type Query {…