Skip to content

Demo project with GraphQL and SpringBoot and Lombok

Notifications You must be signed in to change notification settings

averveiko/graphqldemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo project using graphQL

TIPS: for use Lombok install plugin and restart IDEA

API: http://localhost:8080/graphiql

Mutation

query:

mutation {
  createVehicle(type: "Car", modelCode: "LandCruser", brandName: "Toyota", launchDate: "2020-01-10")
  {
    id
  }
}

answer:

{
  "data": {
    "createVehicle": {
      "id": "2",
      "modelCode": "LandCruser"
    }
  }
}

Query

query:

query {
  vehicles(count: 2) {
    id, type, modelCode, modelCode, launchDate
  }
}

answer:

{
  "data": {
    "vehicles": [
      {
        "id": "1",
        "type": "Car",
        "modelCode": "XYZ0192",
        "launchDate": "2016-08-16"
      },
      {
        "id": "2",
        "type": "Car",
        "modelCode": "LandCruser",
        "launchDate": "2020-01-10"
      }
    ]
  }
}

Documentation:

About

Demo project with GraphQL and SpringBoot and Lombok

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages