question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`watchQuery` can't work with `v2.1.3`

See original GitHub issue

watchQuery can’t work with v2.1.3

I tried it like this:

import { Vue, Component } from 'nuxt-property-decorator';


@Component({
     ...
})
export default class IndexPage extends Vue {

    watchQuery: string[] = ['label', 'page'];
...

So strange, i see other hooks like asyncData works well, but watchQuery does nothing when query changes.

Here is a repository to show a demo: https://github.com/shalldie/nuxt-ts-watchQuery

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

5reactions
shalldiecommented, Feb 28, 2019

I found that,

watchQuery must be part of ComponentOptions layout must be a static field of class.

I think thease should be the fields of class instance, or, a description should be in the readme.md

0reactions
genucommented, Jan 1, 2020

Can we have some clarity here? I don’t think I understand the accepted workaround.

I get typing error when I add watchQuery to @Component

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

class ApolloClient - Apollo GraphQL Docs
Provide this object to set application-wide default values for options you can provide to the watchQuery , query , and mutate functions. See...
Read more >
client.watchQuery does not start polling when `pollInterval` given
Intended outcome: When calling client.watchQuery with the pollInterval set, the query should be run periodically with the provided interval.
Read more >
client.watchQuery cannot be called with fetchPolicy set to ...
In my case, the apollo client version was 3.0.2. Updating my package.json "@apollo/client": "~3.4.0" and re running npm i finally did the ...
Read more >
ApolloClient - Client (React) - Apollo GraphQL Docs
The constructor for ApolloClient accepts an ApolloClientOptions object that supports the required and optional fields listed below. These fields make it easy to ......
Read more >
@apollo/client | Yarn - Package Manager
Apollo Client is a fully-featured caching GraphQL client with integrations for React, Angular, and more. It allows you to easily build UI components...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found