This file contains 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
Mutation: { | |
login: (parent, args, context, info) => { | |
const { email } = args; | |
const user = getUserByEmail(email); | |
console.log(context); | |
if (user) { | |
context.req = { | |
...context.req, | |
session: user | |
} |
This file contains 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
typealias DCRequestType = (URLRequest, Error) | |
//basically makePostRequest should be a function that returns a URLRequest. Straightforward. | |
// I want the return type to be either a URlRequest or an Error. <URLRequest, Error> something of this kind. | |
// You see what I'm doing right? | |
fileprivate func makePostRequest(apiUrl: String, params: [String: String]) -> <URLRequest, Error> { | |
// build url | |
let urlString = "\(dcoderURL)\(apiUrl)" | |
guard let serviceUrl = URL(string: urlString) else { return nil } |
This file contains 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
/** routes/branches/index.js */ | |
module.exports = function() { | |
router.get() | |
router.post() | |
} | |
/** routes/index.js */ | |
module.exports = function() { |
OlderNewer