Skip to content

Adds the query() method to the Queries doc page #407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Adds the query() method to the Queries doc page #407

wants to merge 1 commit into from

Conversation

bviala
Copy link

@bviala bviala commented Oct 4, 2018

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 :)

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 :)
@Akryum
Copy link
Member

Akryum commented Nov 8, 2018

for example if you need to use a query for a login

This doesn't make any sense. Do a mutation.

Also I do not recommend to do the queries manually, you lose reactivity, SSR support, and your code will be imperative instead of descriptive which increase the risk of bugs.

@Akryum Akryum closed this Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants