🚌 LocoBus GraphQL API

Trip Management System - Development Server

📍 Endpoints

POST /graphql
Main GraphQL endpoint for queries and mutations
GET /health
Health check endpoint
GET /public/schema.graphql
Download GraphQL schema (SDL format)

🔗 Quick Links

Health Check Download Schema Apollo Sandbox

🔐 Authentication

All GraphQL requests require an Authorization header:

For Development/Testing:
Authorization: Bearer mock-token

Any token value works in development mode

📝 Example Request (Postman/cURL)

POST http://localhost:4000/graphql Content-Type: application/json Authorization: Bearer mock-token { "query": "query GetTrips { trips(first: 10) { edges { node { id destination arrivalDate departureDate } } totalCount } }" }

🚀 Using Apollo Sandbox

For an interactive GraphQL explorer:

  1. Click "Apollo Sandbox" button above
  2. Enter endpoint: http://localhost:4000/graphql
  3. Add header: Authorization: Bearer mock-token
  4. Explore the schema and run queries!

📚 Documentation

For detailed API documentation, mutations, and examples, see: