-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Refetch transit leg with a leg query of GTFS GraphQL API #6045
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
Changes from 27 commits
5e18c0a
021e07c
01b460d
2182066
7e2033f
6b92741
e489f05
6bd5d04
a998e52
cf37e89
cd54cbe
4025d5b
b206ce1
15f1f34
20f855a
9b3c4d5
14fd13e
207cd5d
71a6315
cd660b2
97d2180
b75c047
1a43221
58b382f
f6a8d8f
71caaa5
ba100e8
45d6f98
857b815
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| package org.opentripplanner.apis.gtfs.datafetchers; | ||
|
|
||
| import graphql.relay.Relay; | ||
| import graphql.schema.DataFetcher; | ||
| import graphql.schema.DataFetchingEnvironment; | ||
| import java.util.List; | ||
|
|
@@ -23,6 +24,7 @@ | |
| import org.opentripplanner.model.plan.StreetLeg; | ||
| import org.opentripplanner.model.plan.TransitLeg; | ||
| import org.opentripplanner.model.plan.WalkStep; | ||
| import org.opentripplanner.model.plan.legreference.LegReferenceSerializer; | ||
| import org.opentripplanner.routing.alertpatch.TransitAlert; | ||
| import org.opentripplanner.routing.alternativelegs.AlternativeLegs; | ||
| import org.opentripplanner.routing.alternativelegs.AlternativeLegsFilter; | ||
|
|
@@ -189,10 +191,12 @@ public DataFetcher<Boolean> realTime() { | |
| return environment -> getSource(environment).getRealTime(); | ||
| } | ||
|
|
||
| // TODO | ||
| @Override | ||
| public DataFetcher<String> realtimeState() { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just realised that this doesn't use a proper mapper, which I think is a very useful thing. Since I already approved, I wrote the code myself: leonardehrenfried@a763bc5 If you want you can cherry pick it into this PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, too late. I will open another one myself. |
||
| return environment -> null; | ||
| return environment -> { | ||
| var state = getSource(environment).getRealTimeState(); | ||
| return (state != null) ? state.name() : null; | ||
| }; | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -324,4 +328,15 @@ public DataFetcher<Iterable<Leg>> nextLegs() { | |
| public DataFetcher<Double> accessibilityScore() { | ||
| return environment -> NumberMapper.toDouble(getSource(environment).accessibilityScore()); | ||
| } | ||
|
|
||
| @Override | ||
| public DataFetcher<String> id() { | ||
| return environment -> { | ||
| var ref = getSource(environment).getLegReference(); | ||
| if (ref == null) { | ||
| return null; | ||
| } | ||
| return LegReferenceSerializer.encode(ref); | ||
| }; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -151,6 +151,8 @@ | |
| arrival | ||
| } | ||
| accessibilityScore | ||
| id | ||
| realtimeState | ||
| } | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.