Created
April 27, 2017 01:50
-
-
Save allpwrfulroot/8c26770ab5d353563eb1b5276666bceb to your computer and use it in GitHub Desktop.
Problem solve grahpql
This file contains 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
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