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
// Traverse an object and attempt to extract the value(s) of one | |
// or more properties, without worrying about non-Object values. | |
const maybe = (obj, traverse, fields) => { | |
if (!(fields instanceof Array)) { | |
fields = [fields] | |
} | |
let result |
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
const express = require('express') | |
const graphqlHTTP = require('express-graphql') | |
const { buildSchema } = require('graphql') | |
const { addMockFunctionsToSchema } = require('graphql-tools') | |
const app = express() | |
const schema = buildSchema(` | |
...your schema here... |