CommonGarden/graphql-schema

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

graphql-schema

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: {
},



This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.