{"id":18806921,"url":"https://github.com/buma/r5docs","last_synced_at":"2026-01-27T05:08:11.201Z","repository":{"id":148413979,"uuid":"51605469","full_name":"buma/R5Docs","owner":"buma","description":"Short documentation for Grapql R5 usage","archived":false,"fork":false,"pushed_at":"2016-06-21T13:30:59.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-29T21:28:20.709Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/buma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-12T17:47:01.000Z","updated_at":"2019-03-13T17:28:08.000Z","dependencies_parsed_at":"2023-06-09T22:45:31.827Z","dependency_job_id":null,"html_url":"https://github.com/buma/R5Docs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buma%2FR5Docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buma%2FR5Docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buma%2FR5Docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buma%2FR5Docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buma","download_url":"https://codeload.github.com/buma/R5Docs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239742416,"owners_count":19689309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T22:50:01.432Z","updated_at":"2026-01-08T21:30:18.537Z","avatar_url":"https://github.com/buma.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQl R5 Documentation\n\nFor testing GraphQL [GraphiQL](https://github.com/graphql/graphiql) is great. It also shows documentation (names and description of API).\n\nProvided index.html file is already built graphiQL so node.js is not needed. It also has URL set to default R5 GraphiQL URL:`http://localhost:8080/otp/routers/default/index/graphql`.\n\nGraphQL server needs to be running before starting GraphiQL since it uses GraphQL server to get GraphQL schema to show documentations and for validation.\n\nGraphl API is also used on [new Debug API](http://localhost:8080/new.html).\n\n## GraphQl Schema:\n![Example graph](https://rawgit.com/buma/R5Docs/master/resources/schemaDiagram.svg)\n\n[Schema.json](https://github.com/buma/R5Docs/blob/master/resources/graphqlSchema.json)\n\nExample request (This uses GraphQl variables) Currently accessModes and other values that accept list can't be used as GraphQL variables since they can't be deserialized):\n```graphql\nquery requestPlan($fromLat:Float!, $fromLon:Float!,\n  $toLat:Float!, $toLon:Float!,\n$fromTime: ZonedDateTime!, $toTime:ZonedDateTime!) {\n  plan(fromLat:$fromLat, fromLon:$fromLon,\n  toLat:$toLat,toLon:$toLon,\n  fromTime:$fromTime, toTime:$toTime, directModes:[CAR, WALK],\n  accessModes:[WALK, BICYCLE], egressModes:[WALK],\ntransitModes:[BUS]) {\n  \n patterns{tripPatternIdx, routeId, routeIdx}\n  \n  options {\n    summary,\n    itinerary {\n      waitingTime\n      walkTime\n      distance\n      transfers\n      duration\n      transitTime\n      startTime\n      endTime,\n      connection {\n      #this is index in access array\n        access \n        #this is index in egress array\n        egress,\n        #this is array with all transit segment. Each transitSegment is one part of transit journey. If there are multiple there are transfers\n        #transit index is same here as in transit array so if there are two transit elements with first first transitSegment is meant and with second second\n        transit {\n        #pattern index of pattern in specific transitSegment\n          pattern\n          #time index of from/to times in specific pattern\n          time\n        }\n      }\n    \n    }\n    \n    \n    transit {\n      from {\n        name,\n        code\n        stopId,\n        zoneId,\n        lon,\n        lat,\n      },\n       to {\n        name,\n        code\n        stopId,\n        zoneId,\n        lon,\n        lat,\n      },\n      mode,\n      routes {id routeIdx shortName, mode},\n      #this is array which index is specified in itinerary.transit.pattern\n      segmentPatterns {\n      #this is Transport network pattern \n      #Rest of Trip info is in patterns with corresponding tripPatternIdx\n        patternIdx\n        #to find route info search in routes array is needed since GraphQL doesn't support maps\n        routeIdx\n        fromIndex\n        toIndex,\n        #this are arrays which index is specified in itinerary.connection.transit.time\n        fromDepartureTime\n        toArrivalTime\n        \n     \n      }\n      #is non null if there are transfers this is path between last stop of this transitSegment and to first of next mode is always WALK\n      middle {\n        mode\n        duration\n        distance\n        geometryGeoJSON\n      }\n    },\n    \n    access {\n      mode,\n      duration,\n      distance,\n      geometryWKT,\n      \n\n      streetEdges {\n        edgeId\n        distance\n        geometryWKT\n        mode\n        streetName\n        relativeDirection\n        absoluteDirection\n        stayOn\n        area\n        exit\n        bogusName,\n        bikeRentalOnStation {\n          id,\n          name,\n          lat,lon\n        }\n      }\n    },\n     egress {\n      mode\n     \n\n      streetEdges {\n        edgeId\n        distance\n        geometryPolyline\n        mode\n        streetName\n        relativeDirection\n        absoluteDirection\n        stayOn\n        area\n        exit\n        bogusName,\n        bikeRentalOnStation {\n          id,\n          name,\n          lon,lat\n        }\n      }\n    }\n  } \n  }\n  \n  #patterns{patternId, startTime, endTime, realTime, arrivalDelay, departureDelay}\n} \n```\nReturn format is mostly the same as previous profile response. The biggest difference is that itinerary object is added which specifies specific trip.\nSome information about return format can be found [here](https://github.com/conveyal/r5/issues/48#issuecomment-165480575).\n\nAnd how to interpret it can be seen in [graphql_plan.js](https://github.com/conveyal/r5/blob/graphQL/src/main/resources/debug-plan/scripts/graphql_plan.js#L408).\n\nJS example in test_lokka.js to run it npm install lokka; npm install lokka-transport-http\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuma%2Fr5docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuma%2Fr5docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuma%2Fr5docs/lists"}