johanatan / speako Goto Github PK
View Code? Open in Web Editor NEWA compiler for GraphQL schema language (written in ClojureScript)
A compiler for GraphQL schema language (written in ClojureScript)
To facilitate mutations that result in multiple items being created/updated/deleted, it'd be nice to have the result type be an array ([Foo]
) rather than a singular object (Foo
).
If we have a query like { Foo (username: "jim" password: "asdf=d&asdf") { ... } }
, speako will pass username=jim&password=asdf=d&asdf
as the predicate to the resolvers, which is nigh unparseable. Perhaps it'd be easier for the resolver if we passed an object instead: {username: "jim", password: "asdf=d&asdf"
.
Jonathans-MacBook-Pro:speako jonathan$ node examples/core.js
Created enum type: Episode: descriptor: {:name "Episode", :values {"NEWHOPE" {:value 1}, "EMPIRE" {:value 2}, "JEDI" {:value 3}}}
Created object type thunk: Human
Created input object type thunk: HumanInput for type: Human
Created object type thunk: Droid
Created input object type thunk: DroidInput for type: Droid
Created union type: Character: descriptor: {:name "Character", :types (#object[GraphQLObjectType Human] #object[GraphQLObjectType Droid]), :resolveType #object[Function "function (a){a=cljs.core.keys.call(null,cljs.core.js__GT_clj.call(null,a));return cljs.core.get.call(null,cljs.core.deref.call(null,k.type_map),cljs.core.first.call(null,cljs.core.get.call(null,cljs.core.deref.call(null,k.fields_map),a)))}"]}
/Users/jonathan/Documents/SourceCode/speako/node_modules/graphql/jsutils/invariant.js:19
throw new Error(message);
^
Error: RootQuery.Droid(friends:) argument type must be Input Type but got: [Character].
at invariant (/Users/jonathan/Documents/SourceCode/speako/node_modules/graphql/jsutils/invariant.js:19:11)
at /Users/jonathan/Documents/SourceCode/speako/node_modules/graphql/type/definition.js:335:33
at Array.map (native)
at /Users/jonathan/Documents/SourceCode/speako/node_modules/graphql/type/definition.js:332:44
at Array.forEach (native)
at defineFieldMap (/Users/jonathan/Documents/SourceCode/speako/node_modules/graphql/type/definition.js:318:14)
at GraphQLObjectType.getFields (/Users/jonathan/Documents/SourceCode/speako/node_modules/graphql/type/definition.js:276:44)
at /Users/jonathan/Documents/SourceCode/speako/node_modules/graphql/type/schema.js:207:27
at typeMapReducer (/Users/jonathan/Documents/SourceCode/speako/node_modules/graphql/type/schema.js:219:7)
at Array.reduce (native)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.