[JAVA-14663] Update Graphql code for Boot 2.7.x changes and move to new module (#12729)

This commit is contained in:
Haroon Khan
2022-10-07 18:21:41 +01:00
committed by GitHub
parent ae96297bc2
commit c18ce8a0cf
29 changed files with 452 additions and 249 deletions
@@ -13,24 +13,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [Rate Limiting a Spring API Using Bucket4j](https://www.baeldung.com/spring-bucket4j)
- [Spring Boot and Caffeine Cache](https://www.baeldung.com/spring-boot-caffeine-cache)
- [Spring Boot and Togglz Aspect](https://www.baeldung.com/spring-togglz)
- [Getting Started with GraphQL and Spring Boot](https://www.baeldung.com/spring-graphql)
- [Expose GraphQL Field with Different Name](https://www.baeldung.com/graphql-field-name)
- More articles: [[next -->]](/spring-boot-modules/spring-boot-libraries-2)
### GraphQL sample queries
Query
```shell script
curl \
--request POST 'localhost:8081/graphql' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"query {\n recentPosts(count: 2, offset: 0) {\n id\n title\n author {\n id\n posts {\n id\n }\n }\n }\n}"}'
```
Mutation
```shell script
curl \
--request POST 'localhost:8081/graphql' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"mutation {\n writePost(title: \"New Title\", author: \"Author2\", text: \"New Text\") {\n id\n category\n author {\n id\n name\n }\n }\n}"}'
```
- More articles: [[next -->]](../spring-boot-libraries-2)