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
| const resolvers = { | |
| Mutation: { | |
| singleUpload: (parent, args) => { | |
| return args.file.then(file => { | |
| const {createReadStream, filename, mimetype} = file | |
| const fileStream = createReadStream() | |
| fileStream.pipe(fs.createWriteStream(`./uploadedFiles/${filename}`)) |
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
| import { GraphQLServer, Options } from 'graphql-yoga' | |
| import { mergeSchemas } from 'graphql-tools'; | |
| import { getRemoteSchema } from "./remoteSchema"; | |
| import { SubscriptionClient } from 'subscriptions-transport-ws'; | |
| import * as ws from 'ws'; | |
| if (process.env.NODE_ENV !== 'production') { | |
| require('dotenv').config() | |
| } |
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
| app.directive('ngFocus', ['$parse', function($parse) { | |
| return function(scope, element, attr) { | |
| var fn = $parse(attr['ngFocus']); | |
| element.bind('focus', function(event) { | |
| scope.$apply(function() { | |
| fn(scope, {$event:event}); | |
| }); | |
| }); | |
| } | |
| }]); |