Skip to content

Instantly share code, notes, and snippets.

@vladbatushkov
Last active November 4, 2019 18:49
Show Gist options
  • Save vladbatushkov/49b54fdf34acc5b6e1d11a8640e8f35f to your computer and use it in GitHub Desktop.
Save vladbatushkov/49b54fdf34acc5b6e1d11a8640e8f35f to your computer and use it in GitHub Desktop.
GraphQL useful queries
{
Airline(first: 10){
code
name
flights(first: 5) {
flightNumber
}
}
}
{
Airport(filter: { city: "Bangkok" }){
code
name
destinations(first: 5) {
code
name
}
}
}
{
Airport(filter: { city: "Moscow" }){
code
name
neighbors(first: 1) {
code
name
}
}
}
type Airline {
code: String!
name: String!
country: String!
flights: [Flight] @relation(name: "OPERATED_BY", direction: "IN")
}
type Airport {
code: String!
name: String!
country: String!
city: String!
destinations: [Airport] @relation(name: "FLIES_TO", direction: "OUT")
neighbors: [Airport] @cypher(statement: "MATCH (a:Airport) WHERE this.city = a.city AND this <> a RETURN a")
}
type Flight {
flightNumber: String!
airline: Airline! @relation(name: "OPERATED_BY", direction: "OUT")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment