Adds the query() method to the Queries doc page #407
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello !
For some reasons, the query() method is not presented in the Queries page of the documentation.
This is very weird to me because it's the most simple and straightforward way of making a GraphQL query, just like you would do REST requests with Axios.
For quite some time I just thought there was no way of doing it with vue-apollo, until yesterday I randomly found the method in the API reference.
It can be super useful in some cases, for example if you need to use a query for a login, then it's very weird to do it with Smart Queries. (I know the convention is to use mutations for login, but you don't always choose what your backend dev do)
Implementing an infinite scroll with filters can also be quite a hurdle with Smart Queries.
So I just added a section at the end of the page, but in my humble opinion it should be better placed in the page.
For now the "Simple query" example is actually displaying a Smart Query, which feels weird to me. Smart Queries are a super powerful high level opinionated functionality, but not the most natural way of querying.
If you agree with this, I could make other PRs :)