./gradlew build
cd buiild
java -jar libs/com-abc-api-xxxx.jar
Or
./gradlew bootRun
An example GraphQL Query might look like, and then you can adjust as per schema.
query{
boardings(flightNumber:"919") {
id
flight {
flightNumber
}
firstName
lastName
checkedIn
boardTime
boardingInfo
}
}
An example GraphQL Mutation
mutation {
board {
boardByName(firstName:"chuan",lastName:"chen", flightNumber:"919") {
id
flight {
flightNumber
}
firstName
lastName
checkedIn
boardTime
boardingInfo
}
}
}
http://127.0.0.1:8080/graphql?query={flights(flightNumber:"*") {id flightNumber}}
mutation {
flight {
open(agentSineCode:"30033C", flightNumber:"800",departureAirport:"AKL") {
id
status
gate
flightNumber
airlineOperatingCode
seatMap {
rowList {
seatList {
column
type
}
}
}
}
}
}
All data and actions were based on mock method, it supports board / flight / boardings ... ... Prefer to send post request due to easily manage thing. Just try for fun!
- Switch input parameters to object with validattion
- Added more comment to understand definition
- Do we need airline operating code as input (such as: NZ, 3U, CA ...)? Default is NZ and only use flight number for now ("445", "101"...).
- Doesn't require depature date for all relevant methods for now due to simple style, and default today. May not right?
- Or for No.3/4, we can use id of flight which return from {flight.open}, and rest of call we can simply use this id instead of flight number
- error handling
- Logs
- Monitoring
| No. | Issue | Solution |
|---|
Content type
Image
Digest
Size
89.9 MB
Last updated
over 8 years ago
docker pull herochinese/graphql-abc-api