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:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* E-mail Server configuration | |
* -------------------------------------------------- | |
*/ | |
let options = {}; | |
/** | |
* E-mail server's host |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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. |