Skip to content

Instantly share code, notes, and snippets.

@creimers
Created March 7, 2017 14:35
Show Gist options
  • Save creimers/9a862c0435c43c60943432e4e8e317d5 to your computer and use it in GitHub Desktop.
Save creimers/9a862c0435c43c60943432e4e8e317d5 to your computer and use it in GitHub Desktop.
a basic example of how to use an apollo query with variables and angular 1
queryJobs() {
const jobQuery = gql`
query($city: String) {
jobs(city: $city){
id
title
teaser
imageSmall
published
}
}
`
this.apollo.query({
query: jobQuery,
variables: {
city: "Hannover"
}
}).then( result => console.log('got data: ', result) )
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment