Skip to content

Instantly share code, notes, and snippets.

@SaraVieira
Created March 30, 2018 18:40
Show Gist options
  • Save SaraVieira/8b989a11a46f5af9c2b9fe07e24969a0 to your computer and use it in GitHub Desktop.
Save SaraVieira/8b989a11a46f5af9c2b9fe07e24969a0 to your computer and use it in GitHub Desktop.
<template>
<ApolloQuery :query="query" :variables="{ name: 'vue' }">
<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>
@ganimp84
Copy link

I am trying to follow your below blog

https://medium.com/yld-engineering-blog/using-vue-with-apollo-65e2b1297592,

currently facing this error

vue.esm.js?efeb:591 [Vue warn]: Unknown custom element: <ApolloQuery> - did you register the component correctly? For recursive components, make sure to provide the "name" option

Could you help to understand what I'm missing?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment