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 flatData = [ | |
{ | |
"id":0, | |
"order":1, | |
"name":"trigger", | |
"children":[ | |
1, | |
11 | |
] | |
}, |
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
/* | |
ES6 Chained Class Object | |
*/ | |
class User { | |
let _name; | |
constructor(name) { | |
_name = 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
const path = require("path"); | |
const { map, merge } = require("lodash"); | |
const { makeExecutableSchema } = require("graphql-tools"); | |
module.exports = class GraphQLStitch { | |
constructor(dir) { | |
this.schemaDir = __dirname + "/" + dir; | |
this.schemaFiles = this.readSchemaFiles(); | |
return makeExecutableSchema({ |
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
module.exports.typeDefs = ` | |
extend type Query { | |
getPastry(id: Int!, name: String): Pastry | |
getPastries(temp: Temperature, type: Category): [Pastry] | |
} | |
extend type Mutation { | |
addPastry(name: String!, type: Category!): Success | |
} | |
type Pastry { |
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
require("graphql-tools").makeExecutableSchema({ | |
typeDefs: [ common.typeDefs, drink.typeDefs, food.typeDefs ], | |
resolvers: merge([ common.resolvers, drink.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
module.exports.typeDefs = ` | |
type Query { | |
ping: Boolean! | |
} | |
type Mutation { | |
ping: Boolean! | |
} | |
type Success { | |
status: Boolean! |
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
module.exports.typeDefs = ` | |
extend type Query { | |
getDrink(id: Int!, name: String): Drink | |
getDrinks(temp: Temperature, type: Category): [Drink] | |
} | |
extend type Mutation { | |
addDrink(name: String!, temp: Temperature!, type: Category!): Success | |
} | |
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
define(function () { | |
'use strict'; | |
return { | |
tvViewRateBeta: { | |
name: 'TV View Rate (Visits)', | |
resources: [ | |
'tvViews', | |
'visits' |
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
enum ActionType { | |
HOMEPAGE_VIEW(true), // context aware | |
..., // lots more actions here | |
TV_VIEW(true); | |
private boolean contextAware = false; | |
private ActionType(boolean contextAware) { | |
this.contextAware = contextAware; | |
} |
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
"tvViewsCount": { | |
"metric": { | |
"identifier": "tvViewsCount", | |
"name": "TV Views (Visits)", | |
"resources": [ | |
"tvViewsCount" | |
], | |
"options": { | |
"isPercent": false | |
}, |
NewerOlder