You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Manually adding a smart Query](#manually-adding-a-smart-query)
32
33
-[Mutations](#mutations)
33
34
-[Subscriptions](#subscriptions)
34
35
-[subscribeToMore](#subscribetomore)
35
36
-[subscribe](#subscribe)
36
37
-[Skipping the subscription](#skipping-the-subscription)
38
+
-[Manually adding a smart Subscription](#manually-adding-a-smart-subscription)
37
39
-[Pagination with `fetchMore`](#pagination-with-fetchmore)
38
40
-[Skip all](#skip-all)
39
41
-[Multiple clients](#multiple-clients)
@@ -527,6 +529,20 @@ export const resolvers = {
527
529
}
528
530
```
529
531
532
+
### Manually adding a smart Query
533
+
534
+
You can manually add a smart query with the `$apollo.addSmartQuery(key, options)` method:
535
+
536
+
```javascript
537
+
created () {
538
+
this.$apollo.addSmartQuery('comments', {
539
+
// Same options like above
540
+
})
541
+
}
542
+
```
543
+
544
+
*Internally, this method is called for each query entry in the component `apollo` option.*
545
+
530
546
## Mutations
531
547
532
548
Mutations are queries that changes your data state on your apollo server. For more info, visit the [apollo doc](http://dev.apollodata.com/core/apollo-client-api.html#ApolloClient\.mutate).
@@ -814,7 +830,7 @@ apollo: {
814
830
// Subscriptions
815
831
$subscribe: {
816
832
// When a tag is added
817
-
tags: {
833
+
tagAdded: {
818
834
query:gql`subscriptiontags($type: String!) {
819
835
tagAdded(type: $type) {
820
836
id
@@ -890,6 +906,20 @@ You can also access the subscription directly and set the `skip` property:
890
906
this.$apollo.subscriptions.tags.skip=true
891
907
```
892
908
909
+
### Manually adding a smart Subscription
910
+
911
+
You can manually add a smart subscription with the `$apollo.addSmartSubscription(key, options)` method:
912
+
913
+
```javascript
914
+
created () {
915
+
this.$apollo.addSmartSubscription('tagAdded', {
916
+
// Same options like '$subscribe' above
917
+
})
918
+
}
919
+
```
920
+
921
+
*Internally, this method is called for each entry of the `$subscribe` object in the component `apollo` option.*
922
+
893
923
## Pagination with `fetchMore`
894
924
895
925
*[Here](https://github.com/Akryum/apollo-server-example/blob/master/schema.js#L21) is a simple example for the server.*
0 commit comments