vue-apollo

Missing movies attribute on result Vue GraphQL

倖福魔咒の 提交于 2021-02-11 12:37:47
问题 I am frontend developer so for the first time I got my hands on vue and graphql, I don’t know how exactly to deal with this error: Missing getMovies attribute on result {movies: Array(20)} Here is my code, and I can see the data is fetched successfully in the response on dev tools in chrome: {"data":{"movies":[{"__typename":"Movie","id":11,"overview": Here is the code: <template> <div class="hello"> <ul> <li v-for="movie in movies" :key="movie.id">{{movie.title}}</li> </ul> </div> </template>

Missing movies attribute on result Vue GraphQL

泄露秘密 提交于 2021-02-11 12:37:00
问题 I am frontend developer so for the first time I got my hands on vue and graphql, I don’t know how exactly to deal with this error: Missing getMovies attribute on result {movies: Array(20)} Here is my code, and I can see the data is fetched successfully in the response on dev tools in chrome: {"data":{"movies":[{"__typename":"Movie","id":11,"overview": Here is the code: <template> <div class="hello"> <ul> <li v-for="movie in movies" :key="movie.id">{{movie.title}}</li> </ul> </div> </template>

Access to this.$apollo from Vuex store with vue-apollo in NUXT?

喜夏-厌秋 提交于 2021-02-10 13:59:45
问题 I want to store the user that comes from the login on an action in the vuex store. But there is no access to this.$apollo . export const actions = { UPSERT_USER({ commit }, { authUser, claims }) { this.$apollo .mutate({ mutation: UPSERT_USER_MUTATION, variables: { id: user.uid, email: user.email, name: user.name, picture: user.picture, }, }) } Thanks! 回答1: You should be able to access it like this: export default { actions: { foo (store, payload) { let client = this.app.apolloProvider

Apollo+GraphQL - Heuristic Fragment Manual Matching

痞子三分冷 提交于 2021-02-08 06:25:16
问题 I have a headless Craft CMS that is returning data to my Nuxtjs app through a GraphQL endpoint through Apollo. I have a field that can return one of three different block types: richText , image , and pullQuote . My GraphQL endpoint looks like this: query($section:[String], $slug:[String]) { entries(section: $section, slug: $slug) { id, title, uri, ... on blog_blog_Entry{ contentEngine{ __typename, ...on contentEngine_richText_BlockType{ __typename, id, richText fontColor, backgroundColor } .

Question about parent/child relationships and components

我是研究僧i 提交于 2021-01-28 14:10:26
问题 I'm currently trying to port a project from vuex/REST to vue-apollo. The project shows a list of events, and each event can be expanded to show details, including attendees. So I'm having an EventList component, that fetches the events and all attributes necessary for the list. And I have a EventDetails child component that is expanded from the list onclick. EventDetails requires some event data as well as the list of attendees to render. Problem is, I cannot find an elegant way to build the

How to provide/inject into Vue root instance WITH nuxt and @vue/composition-api?

北战南征 提交于 2020-08-10 04:46:34
问题 I'm trying to use @vue/apollo-composable with my Nuxt-Ts application. This is the example how it should be injected into root instance on a "normal" Vue application: import { provide } from '@vue/composition-api' import { DefaultApolloClient } from '@vue/apollo-composable' const app = new Vue({ setup () { provide(DefaultApolloClient, apolloClient) }, render: h => h(App), }) Problem: I don't know how to get access to the root instance in Nuxt-TS . I tried making a plugin, but it's injected

How to provide/inject into Vue root instance WITH nuxt and @vue/composition-api?

拥有回忆 提交于 2020-08-10 04:46:23
问题 I'm trying to use @vue/apollo-composable with my Nuxt-Ts application. This is the example how it should be injected into root instance on a "normal" Vue application: import { provide } from '@vue/composition-api' import { DefaultApolloClient } from '@vue/apollo-composable' const app = new Vue({ setup () { provide(DefaultApolloClient, apolloClient) }, render: h => h(App), }) Problem: I don't know how to get access to the root instance in Nuxt-TS . I tried making a plugin, but it's injected

How to add headers in login.vue?

眉间皱痕 提交于 2020-05-16 07:58:45
问题 How to update headers of apolloProvider? Please check out nativescript-vue app repo: https://github.com/kaanguru/vue-apollo-login I can not explain properly so please check out the app. I don't know how to update appolloClient headers. App repo has it's own comments and directives. It's easy to install and see by your self. Current Structure of code: Post request submits the user's identifier and password credentials for authentication and gets token in login page. Apollo needs to place the