Я пытаюсь подключить graphql к моему приложению Spring Boot. Я добавил эти 3 пакета в pom.xml
<dependency>
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
<version>14.0</version>
</dependency>
<dependency>
<groupId>com.graphql-java-kickstart</groupId>
<artifactId>graphql-spring-boot-starter</artifactId>
<version>7.0.1</version>
</dependency>
<dependency>
<groupId>com.graphql-java-kickstart</groupId>
<artifactId>graphiql-spring-boot-starter</artifactId>
<version>7.0.1</version>
</dependency>
Путь к контексту моего приложения установлен на /ws
. Вот соответствующая часть моей конфигурации
server:
servlet:
context-path: /ws
session:
timeout: 120m
port: 8080
compression:
enabled: true
Когда я go до /ws/graphiql
, я вижу GraphiQL, но я получаю эту ошибку.
"message": "Request method 'POST' not supported",
"trace": "org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported\n\tat
Я добавил эта конфигурация для моего application.yml
, она ничего не меняет.
graphql:
servlet:
enabled: true
mapping: /graphql
corsEnabled: true
Я пытаюсь отправить запрос через curl
, и я получаю тот же ответ. Я подумал, что может быть проблема с context
, и я получаю 404.
Что еще мне не хватает, что сделает эту работу?