Skip to content

Instantly share code, notes, and snippets.

@vladbatushkov
Last active March 3, 2020 15:54
Show Gist options
  • Save vladbatushkov/c661bf33f080c99f19f07a0964f10cea to your computer and use it in GitHub Desktop.
Save vladbatushkov/c661bf33f080c99f19f07a0964f10cea to your computer and use it in GitHub Desktop.
Example of Query component for GraphQL-to-Neo4j request for Airports
<Query
query={gql`
query airportsPaginateQuery(
$first: Int
$offset: Int
$orderBy: [_AirportOrdering]
$filter: _AirportFilter
) {
Airport(
first: $first
offset: $offset
orderBy: $orderBy
filter: $filter
) {
code
name
city
country
location {
longitude
latitude
}
}
}
`}
variables={{
first: this.state.rowsPerPage,
offset: this.state.rowsPerPage * this.state.page,
orderBy: this.state.orderBy + "_" + this.state.order,
filter: this.getFilter()
}}
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment