This file contains hidden or 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
// ***************************************************************** | |
// Extend pubsub with request-response pattern | |
// Pubsub instance should conform to this interface: | |
// https://github.com/apollographql/graphql-subscriptions/blob/master/src/pubsub-engine.ts | |
// ***************************************************************** | |
// ***************************************************************** | |
// API | |
// request(topic, args) | |
// respond(topic, ({ args, pass, request }) => {}) |
This file contains hidden or 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
// *********************************************************************** | |
// Validator Lib | |
// *********************************************************************** | |
const { Success, Failure } = require('folktale/validation') | |
const fieldPath = (...args) => args.join('.') | |
const optional = args => ([ | |
(path, prop) => { | |
let assertions = args.map(x => x(path, prop)) |
This file contains hidden or 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
[ | |
{ | |
"id": "01", | |
"name": "Alabama", | |
"abbr": "AL" | |
}, | |
{ | |
"id": "02", | |
"name": "Alaska", | |
"abbr": "AK" |
OlderNewer