-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add plan query that follows the relay connection specification #5185
Add plan query that follows the relay connection specification #5185
Conversation
This is still WIP but wanted to open the pr so it's easier for people to make comments about the schema. I will start implementing some things that are less controversial first within this pr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments
@@ -3248,6 +3439,14 @@ enum AbsoluteDirection { | |||
NORTHWEST | |||
} | |||
|
|||
input ScooterPreferences { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you putting that in just for good measure? I don't think we have that implemented at the moment, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this for two reasons: so it's more clear what settings should be defined when you want to adjust scooter travel and so we can in the future support defining different parameters for cycling/scooter. However, on the downside, what should happen now if both cycling and scooter settings are included.
alight: AlightPreferences | ||
transfer: TransferPreferences | ||
realtime: RealtimePreferences | ||
modes: [TransitModePreference!] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably have a think how to integrate Bartosz's filter API here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. I'm going to check at some point if I'm missing some other latest features from this API in this new draft or any cool features from the transmodel API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the current thinking about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't really studied the filter API closely but unless it has major issues, we can port it to this API as is.
I've made lots of comments but I think this is good step in the right direction. Thanks for working on this. |
src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/BicyclePreferencesMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/BicyclePreferencesMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/apis/gtfs/mapping/routerequest/BicyclePreferencesMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/apis/gtfs/model/PlanPageInfo.java
Outdated
Show resolved
Hide resolved
...t/java/org/opentripplanner/apis/gtfs/mapping/routerequest/RouteRequestMapperScooterTest.java
Show resolved
Hide resolved
src/main/java/org/opentripplanner/apis/gtfs/model/PlanPageInfo.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, my last comments are nit-picking and I am happy to approve without fixing them - let me know what you prefere.
src/main/java/org/opentripplanner/apis/gtfs/model/PlanPageInfo.java
Outdated
Show resolved
Hide resolved
….java Co-authored-by: Thomas Gran <t2gran@gmail.com>
directOnly: Boolean = false | ||
|
||
""" | ||
Should only the transit search be done and never suggest itineraries that don't | ||
contain any transit legs. | ||
""" | ||
transitOnly: Boolean = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably have split the transit search(T) and street search(S) in two queries.
- T is time dependent and has a search-window, S is most of the time time-shiftable
- The S result is always first
- The S is excluded when paging
- The only reason to have it together is to use the S to prune the T - but we could probably find other ways to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean two graphql queries or queries within OTP? Rerunning the street routing is indeed unnecessary when paging. We have thought about some caching solutions for this previously.
Is this comment related to @leonardehrenfried 's question about where the penalty should belong to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The one remaining question I had was where accessEgressPenalty
should live. After a bit of deliberation, we decided in today's meeting that we will leave the structure as it is and find a place should we need to add the penalties.
Thanks for spending time on reviewing this. We need to decide when we deprecate the old query and remove the deprecation from this one but I think we can wait some weeks at least. |
Hello, I can't find any mention of this, but where are the old options of |
If I remember correctly, it isn't implemented yet because we wanted to limit the scope of this pr and we didn't necessarily want to implement it in the same way as it was implemented before. Instead, we want to have some sort of a bit more sophisticated filter structure. You are the second person to ask for this feature in the last couple of weeks. I'll bring this topic up in a developer meeting within a week or two. You can also show up in a meeting if you want and we can discuss this. |
Summary
Adds a new plan query that follows the relay connection specification and some new features/enhancements compared to the old plan query in the LegacyGraphQLAPI.
Example query:
A simple "minimal" query:
Issue
closes #4803
Unit tests
Added
Documentation
Not needed yet
Changelog
Will add for sandbox