Skip to content

Instantly share code, notes, and snippets.

View obbap1's full-sized avatar

Obba Paschal obbap1

View GitHub Profile
const {ApolloServer, gql} = require('apollo-server')
const typeDefs = gql`
type User {
email: String!
password: String!
}
type Mutation {
imapMutation(email: String!, password: String!): User!
}
`
@obbap1
obbap1 / crud.js
Created November 24, 2018 02:35
const fs = require('fs');
const path = require('path');
const { promisify } = require("util");
const readFile = promisify(fs.readFile);
const crud = {};
crud.baseDir = path.join(__dirname,'./database');
//Write data to a file
//Initialize redis and create a client.
const redis = require('redis');
const client = redis.createClient();
//Error handler
client.on('error',(err)=>{
console.log("error",err);
return err;
});
//Check if errors occured while connecting to the db.
const initializationOptions = {