Im using Apollo, React and Graphcool. I have a query to get the logged in users ID:
const LoginServerQuery = gql`
query LoginServerQuery {
loggedInUser {
id
}
}
`;
I need to use the returned ID in another query which is called from the same React component. Here Ive hardcoded "xxxxxxxxxxxxx" which is where the dynamic user ID needs to go:
const LocationQuery = gql`
query LocationsQuery {
User(id: "xxxxxxxxxxxxx") {
location {
name
}
}
}
`;