-
-
Notifications
You must be signed in to change notification settings - Fork 524
Open
Labels
Description
In my vue typescript application, I'm trying to use vue apollo with the vue-property-decorator library.
I have the following code:
import { Component, Prop, Vue } from 'vue-property-decorator'
import HeaderPrimary from '@/components/Header/HeaderPrimary.vue'
import query from '@/graphql/users.gql'
@Component({
components: { // Error from here
HeaderPrimary, // ...
}, // to here.
apollo: {
users: query,
},
})
export default class TheHeader extends Vue {
users: any = null
}I'm receiving the following error:
Argument of type '{ components: { HeaderPrimary: {}; }; apollo: { users: DocumentNode; }; }' is not assignable to parameter of type 'VueClass<Vue>'.
Object literal may only specify known properties, but 'components' does not exist in type 'VueClass<Vue>'. Did you mean to write 'component'?
When I remove the apollo part of the @Component, the error goes away.
The app still runs fine and queries correctly, but unfortunately I'm not sure how to get past this TypeScript error.
alukos, xaiyeon and safenotes