Skip to content

Instantly share code, notes, and snippets.

View JeffRMoore's full-sized avatar

Jeff Moore JeffRMoore

  • Funemployed
  • San Francisco
View GitHub Profile
@JeffRMoore
JeffRMoore / compose.js
Created March 15, 2017 19:23
Experimental version of compose
function compose (middleware) {
if (!Array.isArray(middleware)) throw new TypeError('Middleware stack must be an array!')
for (const fn of middleware) {
if (typeof fn !== 'function') throw new TypeError('Middleware must be composed of functions!')
}
return function (context, next, skipNext) {
if (next !== undefined && typeof next !== 'function') {
throw new TypeError('Next must be a function when specified')
}
Base Schema
type Location {
city: String
country: String
}
type User {
id: String!
name: String
@JeffRMoore
JeffRMoore / Graphql-SampleSchema-WIP
Created February 29, 2016 17:10
Sample GraphQL Schema and queries (WIP)
Base Schema
type User {
id: String!
name: String
handle: String
posts: [Post]
}
interface Topic {