A car data API built using GraphQL as query language protocol for the data. The project was developed with Python 3.7, using graphene for the GraphQL implementation. The server is running with Flask. MongoDB is used as the database. Initially, was a local mock.
All queries are described with GraphiQL, in the main page. Still, here's a brief description on them:
allVersions(
before: String
after: String
first: Int
last: Int
fipeCode: String
fuelType: String
id: ID
name: String
price: Float
versionId: Int
year: Int
model: ID
): VersionConnection
allCars(
before: String
after: String
first: Int
last: Int
carId: Int
id: ID
name: String
mark: ID
): CarConnection
The existent mutations are also described in GraphiQL. In short:
mutation createCar($car: CarVersionInput!) {
createCar(carData: $car){
carVersion {
id,
name,
price
}
}
}
{
"car": {
"versionId": 123123,
"price": 5555,
"name": "Teste Rafael",
"fuelType": "Gasolina",
"year": 2019
}
}
mutation ($mark: CarModelInput){
createMark(mark: $mark){
mark{
country, name
}
}
}
{
"mark": {
"country": "Brasil",
"markId": 321,
"name": "Rafael Automóveis"
}
}