Skip to content

Typescript: Property 'myProperty' does not exist on type 'Vue'. #780

Closed
@Nick-Ewer

Description

@Nick-Ewer

Given the code below, the property being referenced in the apollo query will error with this error:
Property 'myProperty' does not exist on type 'Vue'.ts(2339)

@Component({
  apollo: {
    myQuery: {
      variables() {
        return {
          // this.myProperty does not exist on type 'Vue'
          someVariable: this.myProperty,
        }
      }
    }
  }
})
export default class MyComponent extends Vue {
  public myProperty: string = 'hello';
}

This error does not occur in version of vue-apollo prior to 3.0.0-rc.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions