Skip to content

Instantly share code, notes, and snippets.

View tarang9211's full-sized avatar
🦖
Focusing

Tarang Hirani tarang9211

🦖
Focusing
View GitHub Profile
Mutation: {
login: (parent, args, context, info) => {
const { email } = args;
const user = getUserByEmail(email);
console.log(context);
if (user) {
context.req = {
...context.req,
session: user
}
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 }
/** routes/branches/index.js */
module.exports = function() {
router.get()
router.post()
}
/** routes/index.js */
module.exports = function() {