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
import { join } from 'path' | |
import { get } from 'lodash' | |
import { Storage } from '@google-cloud/storage' | |
import { BUCKET_NAME } from '../constants' | |
import { base64MimeType } from '../utils' | |
const gcloudPathKey = join(__dirname, '../gcloud-key.json') | |
const storage = new Storage({ | |
projectId: 'my-project-id', |
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
import firebase from 'firebase' | |
import { filter, map } from 'lodash' | |
import { makeExecutableSchema } from 'graphql-tools' | |
firebase.initializeApp({ | |
databaseURL: 'https://grafire-b1b6e.firebaseio.com', | |
}) | |
const mapSnapshotToEntity = snapshot => ({ id: snapshot.key, ...snapshot.val() }) | |
const mapSnapshotToEntities = snapshot => map(snapshot.val(), (value, id) => ({ id, ...value })) |