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
/* | |
* | |
* Remote linked data (which is local state) | |
*/ | |
const linked = gql` | |
query GetDogs { | |
dog(id: 1) { | |
name | |
isLiked @client # local only state, not computed | |
} |
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 { onError } from "apollo-link-error"; | |
const link = onError(({ graphQLErrors, networkError }) => { | |
if (graphQLErrors) | |
graphQLErrors.map(({ message, locations, path }) => | |
// send error to sentry/service here | |
); | |
if (networkError) | |
// send network / client error to sentry/servic here | |
}); |
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
set nocompatible | |
set hidden | |
syntax enable | |
colorscheme norma | |
let g:airline_theme='bubblegum' | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim |
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 gql from "graphql-tag"; | |
export const UPLOAD_SCHEMA = gql` | |
mutation UploadSchema( | |
$id: ID! | |
$schema: IntrospectionSchemaInput! | |
$tag: String! | |
$gitContext: GitContextInput | |
) { | |
service(id: $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 React from 'react'; | |
import { ApolloConsumer } from 'react-apollo'; | |
import Link from './Link'; | |
const FilterLink = ({ filter, children }) => ( | |
<ApolloConsumer> | |
{cache => ( | |
<Link | |
onClick={() => cache.writeData({ data: { modal: { isOpen: 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 { ApolloServer, gql, Connector } = require("apollo-server"); | |
const users = [{ id: 1, firstName: "James" }]; | |
class UserConnector { | |
getById(id) { | |
return users.find(user => user.id == 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
const Feed = () => ( | |
<View style={styles.container}> | |
<Header /> | |
<Query query={GET_DOGS}> | |
{({ loading, error, data, client }) => { | |
if (loading) return <Fetching />; | |
if (error) return <Error />; | |
return ( | |
<DogList |
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 videoAssetWithDuration = { | |
args: (source, args, context, info) => ({ id: source.id }), | |
fetcher: (id) => fetch(`/api/v1/assets/${id}`), | |
definition: gql` | |
fragment VideoAssetWithDuration($id: ID) on Asset { | |
title | |
description | |
metdata { | |
date | |
info |
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 { createServer } = require("http"); | |
const { create } = require("./lib/js/re/server.js"); | |
const config = require("./database"); | |
const PORT = process.env.PORT || 4000; | |
createServer(create(config[process.env.UP_STAGE || "local"])).listen( | |
PORT, | |
() => { | |
console.log(`started on port ${PORT}`); | |
} |
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
{ | |
"aggregate": { | |
"timestamp": "2018-03-07T15:31:27.676Z", | |
"scenariosCreated": 1200, | |
"scenariosCompleted": 1200, | |
"requestsCompleted": 1200, | |
"latency": { | |
"min": 2.7, | |
"max": 66.6, | |
"median": 4.1, |