Gathering detailed insights and metrics for vue-apollo-decorators
Gathering detailed insights and metrics for vue-apollo-decorators
Gathering detailed insights and metrics for vue-apollo-decorators
Gathering detailed insights and metrics for vue-apollo-decorators
npm install vue-apollo-decorators
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
3 Stars
69 Commits
1 Forks
1 Watching
1 Branches
1 Contributors
Updated on 17 Jan 2022
TypeScript (88.13%)
JavaScript (11.87%)
Cumulative downloads
Total Downloads
Last day
1.6%
65
Compared to previous day
Last week
-19.7%
351
Compared to previous week
Last month
-3.6%
1,300
Compared to previous month
Last year
-32.8%
21,413
Compared to previous year
1
4
33
Use decorators to create Vue Apollo smart queries
1yarn add vue-apollo-decorators 2npm i vue-apollo-decorators
1<script src="https://unpkg.com/vue-apollo-decorators@2.0.0"></script>
There is currently 1 decorator.
@SmartQuery(options: DocumentNode | VueApolloQueryDefinition)
decorator1import gql from "graphql-tag"; 2import { SmartQuery } from "vue-apollo-decorator"; 3import { Vue, Component } from "vue-property-decorator"; 4 5@Component 6export default class YourComponent extends Vue { 7 @SmartQuery<YourComponent, Todo.Query, Todo.Variables>({ 8 query: gql` 9 query Todo($id: String!) { 10 todo(id: $id) { 11 id 12 title 13 } 14 } 15 `, 16 variables() { 17 return { 18 id: this.id, 19 }; 20 }, 21 }) 22 todo: Todo; 23 24 id: number = 0; 25}
is equivalent to
1export default { 2 apollo: { 3 todo: { 4 query: gql` 5 query Todo($id: String!) { 6 todo(id: $id) { 7 id 8 title 9 } 10 } 11 `, 12 variables() { 13 return { 14 id: this.id, 15 }; 16 }, 17 }, 18 }, 19};
@SubscribeToMore(options: SubscribeToMoreOptions)
decorator1import gql from "graphql-tag"; 2import { SmartQuery, SubscribeToMore } from "vue-apollo-decorator"; 3import { Vue, Component } from "vue-property-decorator"; 4 5@Component 6export default class YourComponent extends Vue { 7 @SmartQuery(gql`{ todos { id, title } }`) todo: Todo; 8 @SubscribeToMore({ 9 document: gql` 10 subscription TodoSubscription { 11 todo { 12 id, 13 title, 14 } 15 } 16 `, 17 updateQuery(prevData, { subscriptionData }) { 18 return [...prevData, ...subscriptionData]; 19 }, 20 }) 21 todos: Todo; 22}
is equivalent to
1export default { 2 apollo: { 3 todos: { 4 query: gql`{ todos { id, title } }`, 5 subscribeToMore: [ 6 { 7 document: gql` 8 subscription TodoSubscription { 9 todo { 10 id 11 title 12 } 13 } 14 `, 15 updateQuery(prevData, { subscriptionData }) { 16 return [...prevData, ...subscriptionData]; 17 }, 18 }, 19 ], 20 }, 21 }, 22};
ISC License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
38 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More