Gathering detailed insights and metrics for cycle-graphql-most-driver
Gathering detailed insights and metrics for cycle-graphql-most-driver
Gathering detailed insights and metrics for cycle-graphql-most-driver
Gathering detailed insights and metrics for cycle-graphql-most-driver
A simple, Apollo-based, GraphQL driver to be used with Cycle's most-run
npm install cycle-graphql-most-driver
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
13 Stars
18 Commits
1 Forks
3 Watchers
2 Branches
2 Contributors
Updated on Aug 07, 2019
Latest Version
0.3.0
Package Id
cycle-graphql-most-driver@0.3.0
Size
2.25 kB
NPM Version
3.8.3
Node Version
5.10.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
1
4
This is a driver for all your pure-most Cycle apps (think Motorcycle) that talks to a GraphQL endpoint.
It uses Apollo Client underneath.
/graphql
, but it can be changed by passing the endpoint='/something'
option to makeGraphQLDriver
;withCredentials
is enabled by default (and there's no way to change it);headers={authorization: 'token xyz'}
option to makeGraphQLDriver
; orheaders
(example: {headers: {authorization: 'token xyz'}}
) as an event in the stream that the driver is consuming.npm install --save cycle-graphql-most-driver
1import most from 'most' 2import hold from '@most/hold' 3import Cycle from '@cycle/most-run' 4import {makeDOMDriver, h} from '@motorcycle/dom' 5import {makeGraphQLDriver, gql} from 'cycle-graphql-most-driver' 6 7Cycle.run(app, { 8 DOM: makeDOMDriver('#container'), 9 GRAPHQL: makeGraphQLDriver({ 10 endpoint: '/graphql', 11 templates: { 12 fetchItem: gql` 13query fetchItem($id: ID!) { 14 item($id) { 15 id 16 name 17 description 18 events { 19 time 20 value 21 } 22 } 23} 24 `, 25 fetchAll: gql` 26query { 27 items { 28 id, name 29 } 30} 31 `, 32 setItem: gql` 33mutation setItem($id: ID!, $name: String, $desc: String) { 34 setItem($id, $name, $desc) { 35 id 36 } 37} 38 ` 39 } 40 }) 41}) 42 43function app ({DOM, GRAPHQL}) { 44 let response$ = GRAPHQL 45 .flatMap(r$ => r$ 46 .recoverWith(err => most.of({errors: [err.message]})) 47 ) 48 .filter(({errors}) => { 49 if (errors && errors.length) { 50 console.log('errors:', errors) 51 return false 52 } 53 return true 54 }) 55 .map(({data}) => data) 56 57 let itemList$ = response$.filter(data => data.items) 58 59 let vtree$ = itemList$ 60 .map(items => 61 h('ul', items.map(item => 62 h('li', {props: {id: item.id}}, item.name) 63 )) 64 ) 65 66 return { 67 DOM: vtree$, 68 GRAPHQL: most.from([{ 69 query: 'fetchItems' 70 }, { 71 mutation: 'setItem', 72 variables: { 73 id: 123, 74 name: 'an item', 75 desc: 'this is an item' 76 } 77 }]) 78 } 79}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 1/14 approved changesets -- score normalized to 0
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
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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