Tag: spring

  • Can’t autowire GraphQlTester

    Can’t autowire GraphQlTester

    1 My current dependency set-up for demo api: dependencies { implementation ‘org.springframework.boot:spring-boot-starter-graphql:2.7.2-SNAPSHOT’ implementation ‘org.springframework.boot:spring-boot-starter-web’ testImplementation ‘org.springframework.boot:spring-boot-starter-test:2.7.2-SNAPSHOT’ testImplementation ‘org.springframework:spring-webflux’ testImplementation ‘org.springframework.graphql:spring-graphql-test:1.0.0’ compileOnly ‘org.projectlombok:lombok’ annotationProcessor ‘org.projectlombok:lombok’ } Test class: import com.example.demo.dao.ProfileDao; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.graphql.GraphQlTest; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.graphql.test.tester.GraphQlTester; import static org.springframework.test.util.AssertionErrors.assertNotNull; @GraphQlTest //@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) class DemoApplicationTests { @Autowired GraphQlTester graphQlTester; @MockBean…

  • How to retry a Spring WebSocketGraphQlClient query

    How to retry a Spring WebSocketGraphQlClient query

    0 Using Spring Boot 3.2.4 with Spring WebFlux/GraphQL subscription via Websocket. Server A exposes a graphqlSubscription, and Server B consumes the subscription. They both use the same components (reactor/netty). Steps to Reproduce: // Client side, Initialize the webSocketGraphQlClient ReactorNettyWebSocketClient reactorNettyWebSocketClient = new ReactorNettyWebSocketClient(HttpClient.create(), build); WebSocketGraphQlClient.builder(serverUrl, reactorNettyWebSocketClient).build(); // Call sample webSocketGraphQlClient .document(query) .retrieveSubscription(path) .toEntity(XXXX.class) .retryWhen(Retry.fixedDelay(5, Duration.ofMinutes(1))).blockLast()…

  • How to respond with extensions using graphql-java?

    How to respond with extensions using graphql-java?

    7 My responses from GraphQL have to follow a particular format of { data:{} errors:[{}] extensions:{} } However, I am uncertain how to respond with extensions from my methods. I am using graphql-spring-boot which pulls in graphql-java, graphql-java-tools, and graphql-java-servlet. I understand that my results from a query/mutation method will be wrapped in the data…

  • Graphiql not working due of security – Spring for GraphQL

    Graphiql not working due of security – Spring for GraphQL

    0 I’m trying to use graphiql UI but due of Spring Security, I receive 401. What’s the way to keep /graphql endpoint secured but let /graphiql request to graphql endpoint? I’m on Spring Boot 3.1.4 and Spring For Graphql 1.2.3 If I permitall /graphql it works but I loss security. I Tried also to put…

  • GraphQL field level authorization and nullability

    GraphQL field level authorization and nullability

    2 We’ve implemented field level authorization in the type resolvers of our server, where a field is only returned with a value if the user has access to it, otherwise "null" is returned (with information in the extensions). The reason why we are not just returning an error (with an empty data response) is that…

  • Spring GraphQLmultiple schemas with Query per file

    Spring GraphQLmultiple schemas with Query per file

    1 with Spring-GraphQl if I have following two schemas in the resources/graphql folder: schema1: type Query { bookById(id: ID): Book } type Book { id: ID name: String pageCount: Int author: Author } type Author { id: ID firstName: String lastName: String } schema2: type Query { personByName(name: String): Person } type Person { id:…

  • Using netflix-dgs with WebFlux

    Using netflix-dgs with WebFlux

    0 This might be a dumb questions, with me being a novice getting starting with the whole reactive programming methodology. Task: But I’m working on developing a Spring Boot Netflix DGS based GraphQL API Implementation: So I am using the standard netflix platform dgs libraries and scalars and all that, and in addition i just…

  • Closing all WebSocket sessions using Spring GraphQL

    Closing all WebSocket sessions using Spring GraphQL

    0 I’m working on a Spring GraphQL (newest spring-boot-starter-graphql) project and I’m using WebSocket to establish subscriptions. However, I’m having trouble finding a way to close all WebSocket sessions programmatically. I’ve looked into the documentation and searched for examples, but I couldn’t find a clear solution specific to Spring GraphQL. Most of the resources I…

  • Full Stack Developer (Java, PHP, Typescript, React, GraphQL) – R Systems, Inc. – Remote

    Full Stack Developer (Java, PHP, Typescript, React, GraphQL) – R Systems, Inc. – Remote

    R Systems, Inc. Remote Depends on Experience Contract: W2, Corp-To-Corp, 12 Month(s) No Travel Required Skills Java Typescript React Spring Node GraphQL Job Description Position : Full Stack DeveloperLocation : RemoteDuration : Long Term Job Description:Full Stack Developer with expertise in Java, Typescript, React, Spring, Node, GraphQL or similar technologies. You will perform new design/enhancements…

  • Generate query for Spring method with @GraphQLQuery

    Generate query for Spring method with @GraphQLQuery

    0 I have method: @GraphQLQuery(name = "events", description = "get all events") public List<String> getEvents() { return List.of("test", "test2"); } I need to create query for clients. below example not work: query events{ events{ … String } } what is wrong? spring graphql graphql-java Share Improve this question Follow asked Jun 23 at 13:27 user11149927user11149927…