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
{ | |
"name": "@your-org/graphql-schema", | |
"version": "0.0.1", | |
"description": "GraphQL Schemas for generating types", | |
"main": "schema.graphql", | |
"types": "types.d.ts", | |
"files": [ | |
"schema.graphql", | |
"types.d.ts" | |
] |
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
overwrite: true | |
schema: "schema.graphql" | |
generates: | |
./types.d.ts: | |
plugins: | |
- "typescript" | |
- "typescript-operations" | |
- "typescript-resolvers" |
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 {loadTypedefsSync} from "@graphql-tools/load"; | |
import {GraphQLFileLoader} from "@graphql-tools/graphql-file-loader"; | |
const sources = loadTypedefsSync("node_modules/@your-org/graphql-schema/schema.graphql", { | |
loaders: [new GraphQLFileLoader()], | |
}); | |
const typeDefs = sources.map((source) => source.document); | |
const resolvers = {} |
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 * as admin from "firebase-admin"; | |
import axios from "axios"; | |
admin.initializeApp(); | |
const auth = admin.auth(); | |
const FIREBASE_TOKEN = 'This can be found in the firebase console under Web API Key on the settings page' | |
exports.createTestDataForUser = functions.https.onRequest(async (req, res) => { | |
const {uid} = req.body; |
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 * as functions from "firebase-functions"; | |
import * as admin from "firebase-admin"; | |
admin.initializeApp(); | |
const db = admin.firestore(); | |
async function getAuthToken(request) { | |
if (!request.headers.authorization) { | |
return null; | |
} |
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
/** | |
* Works with [email protected] [email protected] [email protected] [email protected] | |
* You'll need to add `skipLibCheck` for this to work as cors middleware types seems to have an issue in apollo-server-express | |
*/ | |
import {ExpressContext, gql} from "apollo-server-express"; | |
import {ApolloServer,Config} from "apollo-server-cloud-functions"; | |
import * as functions from "firebase-functions"; | |
const books = [ |
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
export const colours =[ | |
'#f5f6f8', // grey | |
'#fff9b1', // yellow | |
'#f5d128', // dark orange | |
'#d0e17a', // light green | |
'#d5f692', // lighter green | |
'#a6ccf5', // light blue | |
'#67c6c0', // torquise | |
'#23bfe7', // blue | |
'#ff9d48', // orange |
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
// In index.js where plugin is initilised | |
localStorage.setItem('BOTTOM_BAR', 'CLOSED') | |
localStorage.setItem('SIDEBAR', 'NONE') | |
miro.onReady(() => { | |
miro.initialize({ | |
extensionPoints: { | |
toolbar: { | |
title: 'Plugin', | |
async onClick() { |
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
// createItem action | |
function createItem(name) { | |
return { | |
type: 'CREATE_ITEM', | |
data: { | |
name | |
} | |
} | |
} |
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
// List item to launch modal to add or edit items | |
function ListItem({ item }) { | |
function onEdit(event) { | |
event.preventDefault() | |
event.stopPropagation() | |
miro.board.ui.openModal(`./item-form.html?itemId=${item.id}&name=${item.name}`) | |
} | |
return ( |