Name: graphql-schema
Owner: Common Garden
Description: grow-iot graphQL schema
Created: 2017-03-30 13:48:22.0
Updated: 2017-03-30 19:21:56.0
Pushed: 2017-03-31 04:24:51.0
Homepage: null
Size: 5
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
grow-iot graphQL schema
rt executableSchema from 'grow-graphql-api';
ig = {
tabase: 'mongodb://localhost:3001/meteor',
date = {
lThings(root, args, context) {
/ do validation of allThings query
similarly allEvents,getThing,getEvent
t schema = executableSchema({ config, validate });
use('/graphql', graphqlExpress((req) => {
Get the query, the same way express-graphql does it
https://github.com/graphql/express-graphql/blob/3fa6e68582d6d933d37fa9e841da5d2aa39261cd/src/index.js#L257
nst query = req.query.query || req.body.query;
(query && query.length > 2000) {
// None of our app's queries are this long
// Probably indicates someone trying to send an overly expensive query
throw new Error('Query too large.');
turn {
schema,
context: {
},