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 g = require('graphql'), | |
graphql = g.graphql, | |
GraphQLSchema = g.GraphQLSchema, | |
GraphQLObjectType = g.GraphQLObjectType, | |
GraphQLString = g.GraphQLString | |
const schema = new GraphQLSchema({ | |
query: new GraphQLObjectType({ name: 'RootQueryType', fields: { | |
hello: { type: GraphQLString, resolve() { return 'world'; } }, | |
ciao: { type: GraphQLString, resolve(){return Promise.resolve("heila")} } |
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
// @flow | |
//"use strict"; | |
interface Evaluable { | |
evaluate(scope: Object): ()=> Evaluable | |
} | |
/* | |
{ type: Lambda ,name:String , argument: String, body: Evaluable } | |
*/ |
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
function prev(prev){return (self)=>(next)=>prev}; | |
function self(prev){return (self)=>(next)=>self}; | |
function next(prev){return (self)=>(next)=>next}; | |
function node(self){return (next)=>(prev)=>(select)=>select(prev)(self)(next?next(node(self)(next)(prev)):next)}; | |
function array2doublelist(array, index){ | |
return index<array.length? | |
node(array[index])(array2doublelist(array,index+1)) | |
:null; |
NewerOlder