Skip to content

Add refetch itinerary query to GTFS API#7749

Draft
m0rii wants to merge 1 commit into
opentripplanner:dev-2.xfrom
HBTGmbH:refetch-itinerary-gtfs-api
Draft

Add refetch itinerary query to GTFS API#7749
m0rii wants to merge 1 commit into
opentripplanner:dev-2.xfrom
HBTGmbH:refetch-itinerary-gtfs-api

Conversation

@m0rii

@m0rii m0rii commented Jun 22, 2026

Copy link
Copy Markdown

Summary

This PR adds a refetchItinerary query to the GTFS GraphQL API. The new query exposes itinerary refetching through the GTFS API and returns the refreshed itinerary result using the existing GraphQL response model.

Issue

This feature is needed so clients can refresh a previously selected itinerary through the GTFS GraphQL API instead of running a completely new trip search.

The implementation adds the new query to the GTFS GraphQL schema and wires it into the existing query data fetcher. The generated GraphQL API classes were updated accordingly. A small result wrapper was added for the refetched itinerary response, and the request mapping was adjusted so the refetch request can be created from the GraphQL input.

Invalid leg identifiers are handled as GraphQL data fetching errors.

Unit tests

Tests were added/updated for the new GTFS API refetch itinerary functionality.

The test coverage includes:

  • GraphQL integration test coverage for invalid leg id handling
  • Expected GraphQL error response verification using query and JSON expectation files
  • Route request mapping test coverage for the related request mapping changes

Manual verification was also done by executing the GraphQL query and checking the returned response structure.

Documentation

No new configuration options were added.

The implementation follows the existing GTFS GraphQL API structure. Non-trivial behavior is covered by tests and by the existing API/request mapping patterns.

Changelog

The PR title describes the added feature:

Add refetch itinerary query to GTFS API

Bumping the serialization version id

This PR does not change the serialized routing graph format, so no serialization version bump is required.

@m0rii m0rii requested a review from a team as a code owner June 22, 2026 13:20
@m0rii m0rii marked this pull request as draft June 22, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant