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 file under src/main/resources/graphql.
[INFO] [, ] [main] org.springframework.graphql.execution.DefaultSchemaResourceGraphQlSourceBuilder - Loaded 1 resource(s) in the GraphQL schema. [INFO] [, ] [main] org.springframework.boot.autoconfigure.graphql.servlet.GraphQlWebMvcAutoConfiguration - GraphQL endpoint HTTP POST /graphql
above logs shows it loaded schema file and exposed endpoint but while requesting through postman i am getting 405 method not allowed
postman
POST http://localhost:8802/graphql
I am fairly new to graphql and any help on this is appreciated. Thanks
After going through all documentation and other resources. I was able to find the bug in latest spring upgrade for graphql.