Skip to content

rednavis/spring-graphql-microservice

Repository files navigation

Build Status Codacy Badge codecov

spring-graphql-microservice

Build

  1. ./gradlew clean bootJar jibDockerBuild
  2. docker-compose up

Eureka

Swagger

Test microservice status

Generate mock data

GraphiQL

Test query:

findAll

query {
  findAll {
    id
    name
    age
    city
    salary
  }
}

findById

query {
  findById(id: "5e3d2640908949394a94abfc") {
    id
    name
    age
    city
    salary
  }
}

insert

mutation {
  insert(employeeDto: {
    name: "Test Name",
    age: 999,
    city: "Test City",
    salary: 999999
  	}) 
  {
    id
  }
}

save

mutation {
  save(employeeDto: {
    id: "5e3d3362e7113164ae7029e8"
    name: "Test Name_Update",
    age: 999,
    city: "Test City_Update",
    salary: 999999
  	}) 
  {
    id
  }
}

deleteById

mutation {
  deleteById(id: "5e3d3362e7113164ae7029e8")
}

Test query:

findAll

query {
  findAll {
    id
    name
    employees {
      id
      name
      age
      city
      salary
    }
  }
}

findById

query {
  findById(id: "5e3d5a644534b56469a002ba") {
    id
    name
    employees {
      id
      name
      age
      city
      salary
    }
  }
}

Test query:

findAll

query {
  findAll {
    id
    name
    departments {
      id
      name
    }
  }
}

findById

query {
  findById(id: "5e3d5a644534b56469a002ba") {
    id
    name
    departments {
      id
      name
    }
  }
}