https://github.com/ashutoshsahoo/order-service
Order service based on GraphQL implementation
https://github.com/ashutoshsahoo/order-service
gradle graphql graphql-java graphql-spring-boot graphql-spring-boot-security graphql-spring-boot-starter graphql-spring-security java-11 jwt jwt-token lombok spring-security spring-security-jwt
Last synced: about 1 month ago
JSON representation
Order service based on GraphQL implementation
- Host: GitHub
- URL: https://github.com/ashutoshsahoo/order-service
- Owner: ashutoshsahoo
- Created: 2020-06-15T13:42:15.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-15T17:01:40.000Z (almost 6 years ago)
- Last Synced: 2025-10-07T02:50:25.602Z (8 months ago)
- Topics: gradle, graphql, graphql-java, graphql-spring-boot, graphql-spring-boot-security, graphql-spring-boot-starter, graphql-spring-security, java-11, jwt, jwt-token, lombok, spring-security, spring-security-jwt
- Language: Java
- Size: 75.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Order Service
## Signup
```graphql
mutation($request: SignupRequest!) {
signup(request: $request) {
username
email
roles
}
}
```
and query variable
```graphql
{
"request": {
"username": "ashutosh",
"password": "ashu@123",
"email": "ashu@email.com"
}
}
```
## Signin
```graphql
mutation($request: LoginRequest!){
login(request: $request){
token
username
roles
}
}
```
and query variable
```graphql
{
"request": {
"username": "ashutosh",
"password": "ashu@123"
}
}
```
Use the response token to add into Authorization header for all the following requests.
## Create product
```graphql
mutation($product: ProductInput!) {
createProduct(product: $product) {
id
name
}
}
```
and query variable
```graphql
{
"product": {
"id": "1",
"name": "samsung tv",
"description": "Its a good tv",
"price": "20000"
}
}
```
## Query product by id
```graphql
query {
productById(id: "1") {
id
name
}
}
```
## Query customer by id
```graphql
query {
customerById(id: "1") {
id
name
orders {
quantity
id
product {
id
name
}
}
}
}
```
## Create order
```graphql
mutation($order: CreateOrderInput!) {
createOrder(order: $order) {
id
customer {
name
}
product {
name
description
price
}
quantity
status
}
}
```
and query variable
```graphql
{
"order": {
"customerId": "1",
"productId": "1",
"quantity": 3
}
}
```