@grapheng/connection
v0.0.3-alpha.0
Published
Helpers for making GraphQL Connections.
Downloads
1
Readme
Connection
Connection
encapsulates a few GraphQL types and helpers that aid in implementing the industry-standard "Connection" concept.
Install
npm i --save @grapheng/connection
Use
import * as Connection from '@grapheng/connection'
const myTypeDefs = gql`
${Connection.typeDefs}
${myOtherSchema}
`
const myResolvers = {
myItems: (source, { first, after }) =>
Connection.makeConnection(
source.items.map(node => ({ node, additionalEdgeProperties: {} })),
first,
after
)
}