Skip to content

Instantly share code, notes, and snippets.

View KieronWiltshire's full-sized avatar
🏠
Working from home

Kieron Wiltshire KieronWiltshire

🏠
Working from home
View GitHub Profile
plugin A = returns {
  user {
    email
  }
  post {
    text
  }
}

So basically, GraphQL's main principle is that in theory, it should allow you to make 1 single call to the web service, and retrieve as much data as you may possibly need. An example below:

http://somedomain.com/graphql?query={ user, posts }

The call above would retrieve all of the users and all of the posts.

Now my issue is that, if I namespace everything on routes like so:

/**
* Send the specified user their email verification token
* @param {Object} options
* @returns {Promise<>}
*/
self.sendEmailVerificationToken = function(options) {
return new Promise(function(resolve, reject) {
self.find(options).then(function(user) {
return mailer('email.user.email-verification', {
'to': user.email,
'use strict';
var path = require('path');
var config = require('./config');
var debug = require('debug')('web:mailer');
var nodemailer = require('nodemailer');
var smtp = require('nodemailer-smtp-transport');
var _ = require('lodash');
var fs = require('fs');
var errors = require('./errors');
> mocha
api
user
registration
√ should return 0 users (56ms)
√ should register a new user (145ms)
[2016-05-24 12:15:10] INFO: Sending mail using SMTP/2.5.0[client:2.5.0]
√ should return 1 user
'use strict';
/**
* E-mail Server configuration
* --------------------------------------------------
*/
let options = {};
/**
* E-mail server's host
package com.dracade.ember.core;
import com.dracade.ember.Ember;
import org.spongepowered.api.event.Subscribe;
import org.spongepowered.api.event.entity.player.PlayerDeathEvent;
public class TeamDeathmatch implements Minigame {
/**
* Some minigame constructor.
package com.dracade.ember.core;
import org.spongepowered.api.world.Location;
import java.util.List;
public class TeamArena extends Arena {
private List<Location> teamA;
private List<Location> teamB;
//
// My 'exceptions.js' file
//
var createError = require('create-error');
/**
* InvalidSubjectType exception
*
* This exception should be thrown if the subject type
* provided to the object constructor doesn't exist.