Skip to content

danilomeneghel/medical_management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot and Graphql

Main Information

📖 Information

  • Graphql is a query language to handle crud and other operations and is an alternative to REST for Web APIs.
  • To handle with all opeations, a file extension of .graphql should be defined.
  • All processes of query and mutation should becovered from GraphQLQueryResolver and GraphQLMutationResolver

🔨 Run the App

1 ) Install GraphiQL from this website (https://www.electronjs.org/apps/graphiql)

2 ) Check if all maven dependencies are installed by using this code mvn clean install

3 ) Add all relevant graphql dependencies in pom.xml

4 ) Define a query endpoint URL in the GraphiQL (http://localhost:8081/graphql)

5 ) Run the GraphiQL after defining queries with its variable in its essential parts of the program

6 ) Show its result in h2 database after connecting with this url (http://localhost:8081/h2-console/)

Table

Entity Query Information Query Query Variables
Hospital
Get All Hospital List { hospitals { id name } } No Query Variable
Get Hospital by Id query{ hospital(id:3) { id name } } No Query Variable
Add New Hospital mutation newHospital($hospitalInput: HospitalInput!) { newHospital(hospital: $hospitalInput){ name } } { "hospitalInput": { "name": "Hospital 6" } }
Update Hospital By Id mutation { updateHospital ( id: 6 name: "Hospital 6 Updated") { id name } } No Query Variable
Delete Hospital by Id mutation { deleteHospital (id: 6) } No Query Variable
Department
Get All Department list with showing Hospital and Doctor { departments{ id name doctors{ id firstName lastName salary position age birthday } hospital{ id name } } } No Query Variable
Get All Department list with showing only Doctor { departments{ id name doctors{ id firstName lastName salary age birthday } } } No Query Variable
Get All Department list with showing only Hospital { departments{ id name hospital{ id name } } } No Query Variable
Get All Department list with showing its information { departments{ id name } } No Query Variable
Get Department by Id with showing Hospital and Doctor query { department(id:6){ id name doctors{ id firstName lastName salary position age birthday } hospital{ id name } } } No Query Variable
Get Department by Id with showing Hospital query { department(id:6){ id name hospital{ id name } } } No Query Variable
Get Department by Id with showing Doctor query { department(id:6){ id name doctors{ id firstName lastName salary position age birthday } } } No Query Variable
Get Department by Id with showing its information query { department(id:6){ id name } } No Query Variable
Get Department by Id with showing its information query { department(id:6){ id name } } No Query Variable
Add New Department mutation newDepartment($departmentInput: DepartmentInput!) { newDepartment(department: $departmentInput){ name hospital{ id } } } { "departmentInput": { "name": "Department 10", "hospitalId": 3 } }
Update Department By Id mutation updateDepartment($departmentInput: DepartmentInput!) { updateDepartment(id: 10,department: $departmentInput){ name } } { "departmentInput": { "name": "Department 10 Update", "hospitalId": 3 } }
Delete Department By Id mutation { deleteDepartment (id: 10) } No Query Variable
Doctor
Get All Doctor list with showing Department and Hospital { doctors{ id firstName lastName position age salary birthday department{ id name } hospital{ id name } } } No Query Variable
Get All Doctor list with showing only Hospital { doctors{ id firstName lastName position age salary birthday hospital{ id name } } } No Query Variable
Get All Doctor list with showing only Department { doctors{ id firstName lastName position age salary birthday department{ id name } } } No Query Variable
Get All Doctor list with showing its information { doctors{ id firstName lastName position age salary birthday } } No Query Variable
Get Doctor by Id with showing Department and Hospital { doctor(id : 2){ id firstName lastName position age salary birthday department{ id name } hospital{ id name } } } No Query Variable
Get Doctor by Id with showing Hospital { doctor(id : 2){ id firstName lastName position age salary birthday hospital{ id name } } } No Query Variable
Get Doctor by Id with showing Department { doctor(id : 2){ id firstName lastName position age salary birthday department{ id name } } } No Query Variable
Get Doctor by Id with showing its information { doctor(id : 2){ id firstName lastName position age salary birthday } } No Query Variable
Get Doctor by Filter covering that Doctor has a surgeon, is greater than the age of 30 and its salary is greater than 12K { doctorsWithFilter(filter: { position: { operator: "eq", value: "Surgeon" }, age: { operator: "gt" value: "30" } salary: { operator: "gt" value: "12000" } }) { id firstName lastName age salary position birthday } } No Query Variable
Get Doctor by Filter covering that its birthdate ranges from "1980-01-01" to "1990-05-01" { doctorsWithFilter(filter: { birthday:{ operator: "birthdayDate" value: "1980-01-01,1990-05-01" } }) { id firstName lastName age salary position birthday } } No Query Variable
Add New Doctor mutation newDepartment($doctorInput: DoctorInput!) { newDoctor(doctor: $doctorInput){ firstName lastName position age salary birthday department{ id name } hospital{ id name } } } { "doctorInput": { "firstName": "FirstName üğişçöı", "lastName": "LastName ÜĞİŞÇÖI", "position": "Pediatrician", "salary": 5000, "age": 30, "birthday": "1990-08-02", "departmentId": 5, "hospitalId" : 2 } }
Update Doctor by Id mutation updateDoctor($doctorInput: DoctorInput!) { updateDoctor(id: 8,doctor: $doctorInput){ firstName lastName position age salary birthday department{ name } hospital{ name } } } { "doctorInput": { "firstName": "FirstName üğişçöı Update", "lastName": "LastName ÜĞİŞÇÖI Update", "position": "Obstetrician", "salary": 5000, "age": 30, "birthday": "1990-08-02", "departmentId": 1, "hospitalId" : 1 } }
Delete Doctor by Id mutation { deleteDoctor (id: 8) } No Query Variable

Screenshots

Click here to show the screenshots of project

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Figure 14

Figure 15

Figure 16

Figure 17

Figure 18

Figure 19

Figure 20

Figure 21

Figure 22

Figure 23

Figure 24

Figure 25

Figure 26

Figure 27

Figure 28

Figure 29

Figure 30

Figure 31

Figure 32

Figure 33

Figure 34

Figure 35

Releases

No releases published

Packages

No packages published

Languages