This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Base Schema | |
type Location { | |
city: String | |
country: String | |
} | |
type User { | |
id: String! | |
name: String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Base Schema | |
type User { | |
id: String! | |
name: String | |
handle: String | |
posts: [Post] | |
} | |
interface Topic { |