Skip to content

Instantly share code, notes, and snippets.

Working from home

Kieron Wiltshire KieronWiltshire

Working from home
View GitHub Profile

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

View user.partial.js
* 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('', {
View consoleLog
> mocha
√ 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
View emailOptions.js
'use strict';
* E-mail Server configuration
* --------------------------------------------------
let options = {};
* E-mail server's host
View callbackNotBeingCalled.js
'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');
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 java.util.List;
public class TeamArena extends Arena {
private List<Location> teamA;
private List<Location> teamB;
View help.js
// 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.