Tag: spring-graphql
-
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:…
-
Junit test for suscription mapping not working
0 I have been referring to this https://docs.spring.io/spring-graphql/docs/current/reference/html/#testing to setup test for the subscriptionMapping However when I run the test the subscription start but does not emit the message and ends up in a hangup state. Can someone help me in what am I missing @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) class SubscriptionControllerTest { val client: WebSocketClient =…
-
GraphQL hide certain fields from a response
0 I am completely new to GraphQL – apologies if this is a stupid question. I have a Spring Boot application running GraphQL and have two endpoints as defined in my schema below: type Query { userById(id: ID): User getMe: User } type User { id: ID! email: String! firstName: String! lastName: String! } getMe…
-
Spring Boot Graphql: How can I pre-process an individual query/mutation before it runs the controller method?
0 I want to add an annotation to my controller methods that is used to check if the user can perform an action or access a piece of data before the controller method is called. I want to be able to check each individual query/mutation, rather than each http request which may come with multiple…
-
GraphQL error : Method not allowed error for GraphQL requests with Spring 3.1.1
-1 I have upgraded spring boot to 3.1.1 and I am getting 405 method not allowed for graphql call. I tried all the known options. pom.xml <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-graphql</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> class @Controller public class DemoGraphQLResolver { @QueryMapping(name = "phoneNumber") public List<Party> phoneNumber(@Argument String phoneNumber) { return phoneNumber; } } I have .graphqls…