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 { SubscribeFunction, Observable } from 'relay-runtime'; | |
| import { SubscriptionClient } from 'subscriptions-transport-ws'; | |
| import config from '../config'; | |
| import { getToken } from '../components/auth/security'; | |
| export const setupSubscription: SubscribeFunction = (request, variables) => { | |
| const query = request.text; | |
| const authorization = getToken(); |
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
| { | |
| version: 1, | |
| startTime: '2020-03-31T15:25:05.747Z', | |
| endTime: '2020-03-31T15:25:05.747Z', | |
| duration: 3130, | |
| execution: { | |
| resolvers: [ | |
| { | |
| path: [ 'posts', 'analytics', 'quantity' ], | |
| parentType: 'User', |
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 = { | |
| presets: [ | |
| '@babel/preset-react', | |
| [ | |
| '@babel/preset-env', | |
| { | |
| targets: { | |
| node: 'current', | |
| }, | |
| }, |
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 nodeExternals = require('webpack-node-externals'); | |
| const cwd = process.cwd(); | |
| export const outputPath = path.join(cwd, '.webpack'); | |
| export const outputFilename = 'bundle.js'; | |
| export default { |
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 React, { useContext, useCallback } from 'react'; | |
| export const FeatureFlagContext = React.createContext<string[]>([]); | |
| export const useFeatureFlag = () => { | |
| const features = useContext<string[]>(FeatureFlagContext); | |
| const hasFeature = useCallback( | |
| (feature: string) => { | |
| return features.includes(feature); |
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 rules from "../rbac-rules"; | |
| const check = (rules, role, action, data) => { | |
| const permissions = rules[role]; | |
| if (!permissions) { | |
| // role is not present in the rules | |
| return false; | |
| } | |
| const staticPermissions = permissions.static; |
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: Restore yarn workspaces | |
| id: yarn-cache | |
| uses: actions/cache@master | |
| with: | |
| path: | | |
| node_modules | |
| */*/node_modules | |
| key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
| - name: Install dependencies | |
| if: steps.yarn-cache.outputs.cache-hit != 'true' |
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 firebase from 'firebase/app'; | |
| import 'firebase/messaging'; | |
| import { useEffect, useRef } from 'react'; | |
| import config from '../config'; | |
| import firebaseConfig from './firebaseConfig'; | |
| import { PushTokenAddMutation } from './__generated__/PushTokenAddMutation.graphql'; | |
| import { PushTokenAdd, USER_PUSHENDPOINT_TYPE } from './PushTokenAddMutation'; |
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 CDK from '@aws-cdk/core'; | |
| import * as S3 from '@aws-cdk/aws-s3'; | |
| import * as S3Deployment from '@aws-cdk/aws-s3-deployment'; | |
| import * as Lambda from '@aws-cdk/aws-lambda'; | |
| import * as APIGateway from '@aws-cdk/aws-apigateway'; | |
| import * as SSM from '@aws-cdk/aws-ssm'; | |
| import * as SecretsManager from '@aws-cdk/aws-secretsmanager'; | |
| import { ConfigProps, getParam, ModeStack } from './helpers'; |
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
| CREATE OR REPLACE FUNCTION notify_rows_changes() | |
| RETURNS trigger AS $$ | |
| DECLARE | |
| record JSON; | |
| BEGIN | |
| record := row_to_json(CASE TG_OP | |
| WHEN 'INSERT' THEN NEW | |
| WHEN 'UPDATE' THEN NEW | |
| ELSE OLD | |
| END); |