Skip to content

Instantly share code, notes, and snippets.

@SaraVieira
Created March 30, 2018 18:37
Show Gist options
  • Save SaraVieira/f9dbc7da25bc22c6cd207bccf47aaf54 to your computer and use it in GitHub Desktop.
Save SaraVieira/f9dbc7da25bc22c6cd207bccf47aaf54 to your computer and use it in GitHub Desktop.
<template>
<ApolloQuery :query="query">
<template slot-scope="{ result: { loading, error, data } }">
<span v-if="loading">Loading...</span>
<span v-else-if="error">An error occured</span>
<section v-if="data">
<ul v-if="data.allNameses.length">
<li :key="name.id" v-for="name in data.allNameses" >
{{name.name}}
</li>
</ul>
<span v-else>No names, oh no :(</span>
</section>
</template>
</ApolloQuery>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment