Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

When to use ApolloQuery components vs smart queries? #830

sgarner started this conversation in General
Discussion options

What is the best practice for deciding when to use an ApolloQuery component in the template vs declaring a smart query in the Vue component options? When should you use one instead of the other - or is this just a matter of personal taste?

They both achieve roughly the same thing and both are more or less "declarative" as far as I can tell. I've been leaning towards using ApolloQuery components for everything though the advantages seem limited and I wonder if there are cases where declaring smart queries is preferable?

You must be logged in to vote

Replies: 2 comments

Comment options

@sgarner As far as I understand you cannot access $apollo instance / option / query anywhere in your script if you use the component variant, correct me if I'm wrong.

You must be logged in to vote
0 replies
Comment options

@andreiscripcaru22 probably you can access $apollo of the query component via $refs.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #830 on December 15, 2020 07:05.

AltStyle によって変換されたページ (->オリジナル) /