Last active
November 4, 2019 18:49
-
-
Save vladbatushkov/49b54fdf34acc5b6e1d11a8640e8f35f to your computer and use it in GitHub Desktop.
GraphQL useful queries
This file contains hidden or 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
{ | |
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