Add via to GTFS GraphQL API - #5958
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5958 +/- ##
=============================================
- Coverage 69.74% 69.71% -0.03%
- Complexity 17646 17661 +15
=============================================
Files 2006 2008 +2
Lines 75529 75649 +120
Branches 7730 7741 +11
=============================================
+ Hits 52678 52740 +62
- Misses 20135 20192 +57
- Partials 2716 2717 +1 ☔ View full report in Codecov by Sentry. |
4f03654 to
ab2e8cb
Compare
|
@optionsome The Transmodel GraphQL query is here: Do we want to paper over all these differences? |
2886a15 to
93144e1
Compare
05d8353 to
f4b6906
Compare
|
While still working on the new via implementation - this is in the line of how I think the new APIs should look like. I think it would be nice if all 2 APIs did it almost the same, at least the structure: Note! My via implementation is still work-in-progress, so I might stumble over new restrictions/use-cases altering this. Names are subjct for discussion. The |
|
What if we add another level so we can be more explicit with the restrictions (I didn't use effort on the type/field naming, we can figure out something better for them): |
f0039fb to
ef2c425
Compare
|
I quite like @optionsome's idea here. Can we talk about it in tomorrows meeting? |
7360544 to
7af5d78
Compare
|
I implemented @optionsome's schema suggestion. This is ready for review. |
|
@optionsome Do you remember why it's no longer possible to use several stop IDs as a group? The internal implementation supports it. |
|
Can we merge this after my VIA PR? The API will work better, and you avoid differences in behaviour. The mapping to the new ViaLocation and ViaConnection types will replace the existing request PassThroughPoint. |
|
When is the new via search expected to land? |
|
It looks like Thomas will use the following names in the Transmodel API:
|
via to GTFS GraphQL API
|
Code looks OK to me, but I am getting an error as soon as I add a time value in visit via location: "Exception while fetching data (/planConnection) : class org.opentripplanner.raptor.api.model.AbstractAccessEgressDecorator$1 cannot be cast to class org.opentripplanner.routing.algorithm.raptoradapter.transit.RoutingAccessEgress (org.opentripplanner.raptor.api.model.AbstractAccessEgressDecorator$1 and org.opentripplanner.routing.algorithm.raptoradapter.transit.RoutingAccessEgress are in unnamed module of loader 'app')", Any ideas? The error might not be within the scope of this PR. |
|
I tried with this query from Tampere: Let me merge dev-2.x. Lots of things were refactored and maybe you have some stray class file in your target folder. |
|
It seems that my first random search somehow found a troublesome routing challenge. After changing the endpoint coordinates, everything works fine. OTP logs Too bad that I lost the bad coordinates when making new experiments. |
| } else { | ||
| throw new IllegalArgumentException("ViaLocation must define either pass-through or visit."); | ||
| } |
There was a problem hiding this comment.
This probably is never thrown because of the @oneOf validation on the API. However, I don't know if it hurts to have it here.
There was a problem hiding this comment.
Let me know what you think: I'm happy either way.

Summary
We discussed this previously in the dev meeting with @optionsome. It adds the pass-through points to the
plan()query of the GTFS API.I remember that HSL also wants to use the via point routing and @optionsome was hoping it could be expressed the same input but I'm struggling to add it in an elegant way. Let's discuss this in the dev meeting.
Unit tests
Added.