0.1.1 • Published 6 years ago

cycle-graphql v0.1.1

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

cycle-graphql

build npm

A GraphQL driver for Cycle.js.

API

graphQLActions

Write effects are requested by calling an action generatora function defined on the graphQLActions objectand passed to the GraphQL sink.

  • graphQLActions: object containing:
    • getHeaders() – resolves with the currently set headers object
    • query(queryString: string) – sends the queryString to the GraphQL endpoint; also used for mutations and subscriptions
    • setHeader(headerName: string, value: string) – sets the headerName header value to value
    • unsetHeader(headerName: string) – unsets the headerName header value

<action>.as(category: string)

Attaches a category to the action's result stream, allowing for lookup using the source's select().

makeGraphQLDriver(endpoint: string)

Initializes a GraphQL client pointing to endpoint, returning a source object containing the following:

  • select(category: string): Stream of results from action requests that were categorized using <action>.as().
0.1.1

6 years ago

0.1.0

6 years ago