Skip to content
GraphQl server to get directions between two places(Uses Google directions API)
JavaScript Shell
Branch: master
Clone or download
Latest commit e835d9d Aug 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config 🔧 add db config file Jun 10, 2019
migrations 🗃 create migration and model for users table Jun 10, 2019
scripts 🔧 add post install script config Jun 12, 2019
src bug fixing Aug 14, 2019
.babelrc inital commit Jun 6, 2019
.env.sample 🔧 update sample env file Jun 13, 2019
.gitignore
.prettierrc inital commit Jun 6, 2019
.travis.yml inital commit Jun 6, 2019
LICENSE
Procfile add Procfile Jun 8, 2019
README.md Update README.md Aug 13, 2019
package-lock.json
package.json

README.md

Node GraphQL Server

Sample GraphQL nodejs server.

GraphQL wrapper over the Google directions API.

Graphiql

Frontend App

Sample Query

fragment TransitPointDetailsParts on TransitPointDetails {
  formatedTime
  address
  timeZone
  timeValue
  location {
    latitude
    longitude
  }
}
fragment OtherPointDetailsParts on OtherPointDetails {
  address
  location {
    latitude
    longitude
  }
}
fragment TripDataPart on TripData {
  arrival {
    ... on TransitPointDetails {
    	...TransitPointDetailsParts
    }
    ... on OtherPointDetails {
      ...OtherPointDetailsParts
    }
  }
  departure {
    ... on TransitPointDetails {
    	...TransitPointDetailsParts
    }
    ... on OtherPointDetails {
      ...OtherPointDetailsParts
    }
  }
  tripDuration {
    ...TypedDataParts
  }
  tripDistance {
    ...TypedDataParts
  }
}
fragment TypedDataParts on TypedData {
  formattedValue
  rawValue
}
fragment CoordsPart on Coords {
  latitude
  longitude
}
query($coordinates: PlaceCoordinatesInput!, $travelMode: AllowTravelModes!) {
  direction(coordinates: $coordinates, travelMode: $travelMode) {
    fare {
      formattedFare
      currency
      fareValue
    }
    tripData {
      ...TripDataPart
    }
    steps {
      stepTravelMode
      stepDistance {
        ...TypedDataParts
      }
      stepDuration {
        ...TypedDataParts
      }
      startLocation {
        ...CoordsPart
      }
      endLocation {
        ...CoordsPart
      }
      polyline
      stepInstruction
      ... on WalkStep {
        walkSteps {
          stepTravelMode
          stepInstruction
        }
      }
      ... on TransitStep {
        arrival {
        	...TransitPointDetailsParts
        }
        departure {
          ...TransitPointDetailsParts
        }
        transitData {
          tripName
          tripShortName
          url
          headSign
          stopsCount
          vehicleIcon
          vehicleName
          vehicleType
        }
      }
    }
  }
}

input:
{
  "coordinates": {
    "startLat": 37.7919227,
    "startLng": -122.4152148,
    "endLat": 37.6213171,
    "endLng": -122.3811441
  },
  "travelMode": "walking"
}
You can’t perform that action at this time.