- Clone the repo
git clone https://github.com/kibettheophilus/kenyan-counties.git
- Create a database in MongoDB with name
counties
and add the uri to theapplication.yml
- Run the project
./gradlew bootRun
- Open http://localhost:8080/graphiql to access using graphiql(or connect to http://localhost:8080/graphql using postman or altair Graphql Client )
- Add data to the db using the
addCounty
mutation
, below is a sample
mutation {
addCounty(county: {
code:"001",
name:"Mombasa"
constituencies: {
name: "Jomvu",
wards:"Shanzu South, Shanzu North"
}
}){
status
message
details {
code
name
}
}
}
- Fetch data using the
getCounties
query
, below is a sample
query{
getCounties(name:"Mombasa") {
status
message
details {
name
code
constituencies {
name
wards
}
}
}
}
- Spring Boot
- Java
- Grapqhl - Using DGS framework
- MongoDb


