-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5339 from ibi-group/graphql-move
Move GTFS GraphQL API out of the sandbox
- Loading branch information
Showing
130 changed files
with
462 additions
and
507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# GTFS GraphQL API | ||
|
||
The GTFS GraphQL API is a general purpose API which was created for the Digitransit project and is | ||
used heavily by [digitransit-ui](https://github.com/HSLdevcom/digitransit-ui). | ||
|
||
[otp-react-redux](https://github.com/opentripplanner/otp-react-redux) has also migrated to this API in 2023. | ||
|
||
## URLs | ||
- GraphQL endpoint: [`http://localhost:8080/otp/routers/default/index/graphql`](http://localhost:8080/otp/routers/default/index/graphql) | ||
- HTML schema documentation: [https://docs.opentripplanner.org/api/dev-2.x/graphql-gtfs/](https://docs.opentripplanner.org/api/dev-2.x/graphql-gtfs/) | ||
- Built-in visual GraphQL client: [http://localhost:8080/graphiql](http://localhost:8080/graphiql) | ||
|
||
## Built-in API client | ||
|
||
A browser based GraphQL API client is available at [http://localhost:8080/graphiql](http://localhost:8080/graphiql) | ||
|
||
![GraphiQL](../images/graphiql.png) | ||
|
||
**`curl` example** | ||
|
||
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"}' | ||
``` | ||
## Configuration | ||
|
||
The API is enabled by default. | ||
|
||
If you want to disable it, do it in `otp-config.json`: | ||
|
||
```json | ||
// otp-config.json | ||
{ | ||
"otpFeatures" : { | ||
"GtfsGraphQlApi": false | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.