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
Afghanistan | |
Albania | |
Algeria | |
Andorra | |
Angola | |
Antigua & Deps | |
Argentina | |
Armenia | |
Australia | |
Austria |
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
WITH daily AS ( | |
SELECT | |
PARSE_DATE("%Y%m%d", event_date) as date, | |
HLL_COUNT.init(user_id) users_sketch, | |
FROM `<your_GA_events_table>` | |
GROUP BY 1 | |
), | |
month_day_window AS ( | |
SELECT | |
date, |
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
const firebase = require('firebase-admin'); | |
const resolvers = { | |
Query: { | |
async hello(_, { name }) { | |
return `Hello ${name || 'World'}`; | |
}, | |
async getTodos() { | |
const db = firebase.firestore(); |
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
const typeDefs = ` | |
type Query { | |
hello(name: String): String! | |
getTodos: [Todo] | |
} | |
type Mutation { | |
addTodo(text: String): String! | |
} |
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
const firebase = require('firebase-admin'); | |
const resolvers = { | |
Query: { | |
async hello(_, { name }) { | |
return `Hello ${name || 'World'}`; | |
}, | |
}, | |
Mutation: { |
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
const functions = require('firebase-functions'); | |
const firebase = require('firebase-admin'); | |
let firebaseConfig = functions.config().firebase; | |
firebase.initializeApp(firebaseConfig); | |
const graphql = require('./graphql'); | |
exports.graphql = functions.https.onRequest(graphql); |
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
const { GraphQLServer } = require('graphql-yoga'); | |
const typeDefs = require('./schema'); | |
const resolvers = require('./resolvers'); | |
const server = new GraphQLServer({ | |
typeDefs, | |
resolvers, | |
introspection: true, | |
playground: true, | |
}); |
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
const firebase = require('firebase-admin'); | |
const resolvers = { | |
Query: { | |
async hello(_, { name }) { | |
return `Hello ${name || 'World'}`; | |
}, | |
}, | |
}; |
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
const typeDefs = ` | |
type Query { | |
hello(name: String): String! | |
} | |
type Mutation { | |
addTodo(text: String): String! | |
} | |
`; |
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
const typeDefs = ` | |
type Query { | |
hello(name: String): String! | |
} | |
`; | |
module.exports = typeDefs; |
NewerOlder