Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/conorheffron/graphql-box
GraphQL Playground
https://github.com/conorheffron/graphql-box
graphql jdk17 lombok postman-collection spring-boot-2
Last synced: 12 days ago
JSON representation
GraphQL Playground
- Host: GitHub
- URL: https://github.com/conorheffron/graphql-box
- Owner: conorheffron
- License: mit
- Created: 2024-07-29T04:45:28.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-02T17:23:30.000Z (4 months ago)
- Last Synced: 2024-12-15T11:39:49.908Z (18 days ago)
- Topics: graphql, jdk17, lombok, postman-collection, spring-boot-2
- Language: Java
- Homepage: https://conorheffron.github.io/graphql-box/
- Size: 599 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# graphql-box
[![Java CI with Maven](https://github.com/conorheffron/graphql-box/actions/workflows/maven.yml/badge.svg)](https://github.com/conorheffron/graphql-box/actions/workflows/maven.yml)
## Technologies:
JDK corretto-17.0.9, Spring Boot 2, GraphQL, Maven 3## Build & Run Tests:
```
mvn clean package
```## Run Main Class Directly:
```
com.graphql.box.intro.GraphqlApplication
```## GraphQL Queries & Mutation (Methods: Postman, Curl, & GraphiQL UI)
### Query
#### curl
```
curl \
--request POST 'localhost:8080/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}"}'
```
#### GraphiQL UI
![recentPosts-graphiql](./screenshots/recentPosts-graphiql.png?raw=true "recentPosts-graphiql")#### Postman
![recentPosts-postman](./screenshots/recentPosts-postman.png?raw=true "recentPosts-postman")### Mutation
#### curl
```
curl \
--request POST 'localhost:8080/graphql' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"mutation {\n createPost(title: \"New Title\", authorId: \"Author2\", text: \"New Text\") {\n id\n category\n author {\n id\n name\n }\n }\n}"}'
```
#### GraphiQL UI
![createPost-graphiql](./screenshots/createPost-graphiql.png?raw=true "recentPosts-graphiql")