Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
cycle-graphql-driver
Advanced tools
A simple, Apollo-based, GraphQL driver to be used with Cycle
This driver expects you to pass it an Apollo Client.
/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-driver
import most from 'most'
import hold from '@most/hold'
import {run} from '@cycle/most-run'
import {makeDOMDriver, h} from '@motorcycle/dom'
import ApolloClient, {createNetworkInterface} from 'apollo-client'
import {makeGraphQLDriver, gql} from 'cycle-graphql-driver'
const networkInterface = createNetworkInterface({
uri: '/graphql',
opts: {
credentials: 'include'
}
})
run(app, {
DOM: makeDOMDriver('#container'),
GRAPHQL: makeGraphQLDriver({
client: new ApolloClient({networkInterface}),
templates: {
fetchItem: gql`
query fetchItem($id: ID!) {
item($id) {
id
name
description
events {
time
value
}
}
}
`,
fetchAll: gql`
query {
items {
id, name
}
}
`,
setItem: gql`
mutation setItem($id: ID!, $name: String, $desc: String) {
setItem($id, $name, $desc) {
id
}
}
`
}
})
})
function app ({DOM, GRAPHQL}) {
let response$ = GRAPHQL
.flatMap(r$ => r$
.recoverWith(err => most.of({errors: [err.message]}))
)
.filter(({errors}) => {
if (errors && errors.length) {
console.log('errors:', errors)
return false
}
return true
})
.map(({data}) => data)
let itemList$ = response$.filter(data => data.items)
let vtree$ = itemList$
.map(items =>
h('ul', items.map(item =>
h('li', {props: {id: item.id}}, item.name)
))
)
return {
DOM: vtree$,
GRAPHQL: most.from([{
query: 'fetchItems'
}, {
mutation: 'setItem',
variables: {
id: 123,
name: 'an item',
desc: 'this is an item'
}
}])
}
}
FAQs
A simple, Apollo-based, GraphQL driver to be used with Cycle
The npm package cycle-graphql-driver receives a total of 1 weekly downloads. As such, cycle-graphql-driver popularity was classified as not popular.
We found that cycle-graphql-driver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.