Skip to content
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

Format GraphQL test and documentation files with prettier #5905

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
# project-wide reformatting with prettier
9c9dd613489a348d2381acdcbeab8f86589154d7

# graphql test and documentation reformatting with prettier
12c51f44f204db31d34a1eeb0d59204226e0fa5d

122 changes: 59 additions & 63 deletions docs/apis/GraphQL-Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@ GraphQL query in the left hand panel of the page:

```graphql
{
routes {
longName
shortName
gtfsId
agency {
gtfsId
name
}
mode
routes {
longName
shortName
gtfsId
agency {
gtfsId
name
}
mode
}
}

```

<!-- route-query END -->
Expand All @@ -69,64 +70,59 @@ Most people want to get routing results out of OTP, so lets see the query for th

```graphql
{
plan(
# these coordinates are in Portland, change this to YOUR origin
from: { lat: 45.5552, lon: -122.6534 }
# these coordinates are in Portland, change this to YOUR destination
to: { lat: 45.4908, lon: -122.5519 }
# use the correct date and time of your request
date: "2023-02-15",
time: "11:37",
# choose the transport modes you need
transportModes: [
{
mode: WALK
},
{
mode: TRANSIT
},
]) {
itineraries {
start
end
legs {
mode
from {
name
lat
lon
departure {
scheduledTime
estimated {
time
delay
}
}
}
to {
name
lat
lon
arrival {
scheduledTime
estimated {
time
delay
}
}
}
route {
gtfsId
longName
shortName
}
legGeometry {
points
}
plan(
# these coordinates are in Portland, change this to YOUR origin
from: { lat: 45.5552, lon: -122.6534 }
# these coordinates are in Portland, change this to YOUR destination
to: { lat: 45.4908, lon: -122.5519 }
# use the correct date and time of your request
date: "2023-02-15"
time: "11:37"
# choose the transport modes you need
transportModes: [{ mode: WALK }, { mode: TRANSIT }]
) {
itineraries {
start
end
legs {
mode
from {
name
lat
lon
departure {
scheduledTime
estimated {
time
delay
}
}
}
to {
name
lat
lon
arrival {
scheduledTime
estimated {
time
delay
}
}
}
route {
gtfsId
longName
shortName
}
legGeometry {
points
}
}
}
}
}

```

<!-- plan-query END -->
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@
<inputGlob>src/test/java/**/*.java</inputGlob>
<inputGlob>src/ext/java/**/*.java</inputGlob>
<inputGlob>src/ext-test/java/**/*.java</inputGlob>
<inputGlob>src/test/resources/org/opentripplanner/apis/**/*.graphql</inputGlob>
</inputGlobs>
</configuration>
<executions>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
alerts {
id
alertHeaderText
alertDescriptionText
alertUrl
# these translations are a bit questionable, the above fields are already translated into the
# language selected in the request
alertDescriptionTextTranslations {
language
text
}
alertHeaderTextTranslations {
text
language
}
alerts {
id
alertHeaderText
alertDescriptionText
alertUrl
# these translations are a bit questionable, the above fields are already translated into the
# language selected in the request
alertDescriptionTextTranslations {
language
text
}
}
alertHeaderTextTranslations {
text
language
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
feeds {
agencies {
name
url
}
publisher {
name
url
}
feeds {
agencies {
name
url
}
}
publisher {
name
url
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
edges {
node {
place {
...on Stop {
... on Stop {
id
gtfsId
parentStation {
id
gtfsId
parentStation {
id
}
}
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
{
patterns {
code
headsign
trips {
gtfsId
stoptimes {
stop {
gtfsId
name
}
headsign
scheduledArrival
scheduledDeparture
stopPosition
realtimeState
pickupType
dropoffType
}
occupancy {
occupancyStatus
}
patterns {
code
headsign
trips {
gtfsId
stoptimes {
stop {
gtfsId
name
}
vehiclePositions {
vehicleId
label
lat
lon
stopRelationship {
status
stop {
gtfsId
}
}
speed
heading
lastUpdated
trip {
gtfsId
}
headsign
scheduledArrival
scheduledDeparture
stopPosition
realtimeState
pickupType
dropoffType
}
occupancy {
occupancyStatus
}
}
vehiclePositions {
vehicleId
label
lat
lon
stopRelationship {
status
stop {
gtfsId
}
}
speed
heading
lastUpdated
trip {
gtfsId
}
}
}
}
}
Loading
Loading