-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01bf909
commit b4a4d55
Showing
2 changed files
with
149 additions
and
144 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
// Queries used when server side rendering | ||
// Used for boards on unsupported browsers | ||
import { | ||
TypedDocumentString, | ||
TStopPlaceQuery, | ||
TStopPlaceQueryVariables, | ||
TGetQuayQuery, | ||
TGetQuayQueryVariables, | ||
} from '.' | ||
|
||
export const SSRStopPlaceQuery = ` | ||
query StopPlace($stopPlaceId: String!, $whitelistedTransportModes: [TransportMode], $whitelistedLines: [ID!], $numberOfDepartures: Int = 20, $startTime: DateTime) { | ||
stopPlace(id: $stopPlaceId) { | ||
name | ||
transportMode | ||
estimatedCalls( | ||
numberOfDepartures: $numberOfDepartures | ||
whiteListedModes: $whitelistedTransportModes | ||
whiteListed: {lines: $whitelistedLines} | ||
includeCancelledTrips: true | ||
startTime: $startTime | ||
) { | ||
...departure | ||
} | ||
situations { | ||
...situation | ||
} | ||
} | ||
} | ||
fragment departure on EstimatedCall { | ||
quay { | ||
publicCode | ||
} | ||
destinationDisplay { | ||
frontText | ||
via | ||
} | ||
aimedDepartureTime | ||
expectedDepartureTime | ||
expectedArrivalTime | ||
serviceJourney { | ||
id | ||
transportMode | ||
transportSubmode | ||
line { | ||
id | ||
publicCode | ||
presentation { | ||
textColour | ||
colour | ||
} | ||
} | ||
} | ||
cancellation | ||
realtime | ||
situations { | ||
...situation | ||
} | ||
} | ||
fragment situation on PtSituationElement { | ||
id | ||
description { | ||
value | ||
language | ||
} | ||
summary { | ||
value | ||
language | ||
} | ||
}` as unknown as TypedDocumentString< | ||
TStopPlaceQuery, | ||
TStopPlaceQueryVariables | ||
> | ||
|
||
export const SSRQuayQuery = ` | ||
query getQuay($quayId: String!, $whitelistedTransportModes: [TransportMode], $whitelistedLines: [ID!], $numberOfDepartures: Int = 20, $startTime: DateTime) { | ||
quay(id: $quayId) { | ||
name | ||
description | ||
publicCode | ||
...lines | ||
estimatedCalls( | ||
numberOfDepartures: $numberOfDepartures | ||
whiteListedModes: $whitelistedTransportModes | ||
whiteListed: {lines: $whitelistedLines} | ||
includeCancelledTrips: true | ||
startTime: $startTime | ||
) { | ||
...departure | ||
} | ||
situations { | ||
...situation | ||
} | ||
} | ||
} | ||
fragment departure on EstimatedCall { | ||
quay { | ||
publicCode | ||
} | ||
destinationDisplay { | ||
frontText | ||
via | ||
} | ||
aimedDepartureTime | ||
expectedDepartureTime | ||
expectedArrivalTime | ||
serviceJourney { | ||
id | ||
transportMode | ||
transportSubmode | ||
line { | ||
id | ||
publicCode | ||
presentation { | ||
textColour | ||
colour | ||
} | ||
} | ||
} | ||
cancellation | ||
realtime | ||
situations { | ||
...situation | ||
} | ||
} | ||
fragment lines on Quay { | ||
lines { | ||
id | ||
publicCode | ||
name | ||
transportMode | ||
} | ||
} | ||
fragment situation on PtSituationElement { | ||
id | ||
description { | ||
value | ||
language | ||
} | ||
summary { | ||
value | ||
language | ||
} | ||
}` as unknown as TypedDocumentString<TGetQuayQuery, TGetQuayQueryVariables> |