HSL Legacy GraphQL API - OTP Sandbox Extension

Contact Info

Changelog

Documentation

This is a copy of HSL's GraphQL API used by the Digitransit project. The API is used to run OTP2 together with the digitransit-ui.

The GraphQL endpoints are available at:

A complete example that fetches the list of all stops from OTP is:

curl --request POST \
  --url http://localhost:8080/otp/routers/default/index/graphql \
  --header 'Content-Type: application/json' \
  --header 'OTPTimeout: 180000' \
  --data '{"query":"query stops {\n  stops {\n    gtfsId\n    name\n  }\n}\n","operationName":"stops"}'

Built-in API client

A browser based GraphQL API client is available at http://localhost:8080/legacygraphql/graphiql

OTP2 Official GraphQL API (Not available)

We plan to make a new offical OTP2 API, replacing the REST API. The plan is to base the new API on this API and the Legacy GraphQL Api. The new API will most likely have 2 "translations": A GTFS version and a Transmodel version, we will try to keep the semantics the same.

Configuration

To enable this you need to add the feature SandboxAPILegacyGraphQLApi.

// otp-config.json
{
  "otpFeatures" : {
    "SandboxAPILegacyGraphQLApi": true
  }
}