Skip to content

Instantly share code, notes, and snippets.

@allpwrfulroot
Created April 27, 2017 01:50
Show Gist options
  • Save allpwrfulroot/8c26770ab5d353563eb1b5276666bceb to your computer and use it in GitHub Desktop.
Save allpwrfulroot/8c26770ab5d353563eb1b5276666bceb to your computer and use it in GitHub Desktop.
Problem solve grahpql
const GetAllTripsQuery = gql`
query GetAllTrips($tripargs: TripWhereArgs) {
viewer {
id
user {
id
domicile
abodes
trips(where: $tripargs, orderBy: { field: start, direction: DESC }) {
pageInfo {
hasNextPage
hasPreviousPage
}
edges {
cursor
node {
id
start
end
jurisdiction
description
pending
records(orderBy: { field: date, direction: DESC }) {
edges {
node {
id
date
taxed
workday
category
pings(orderBy: { field: timestamp, direction: DESC }, first: 1) {
edges {
node {
id
timestamp
}
}
}
}
}
}
}
}
}
}
}
}
`
export default compose(
graphql(GetAllTripsQuery, {
options: (props) => ({
variables: {
tripargs: {
start: {
gte: moment().startOf('year').format()
}
}
}
})
})
)(Geolocation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment