Skip to content

Instantly share code, notes, and snippets.

View jbaxleyiii's full-sized avatar
💼
Moved to management

James Baxley jbaxleyiii

💼
Moved to management
View GitHub Profile
+ export type InputProps = {
+ episode: string,
+ };
+ export const withCharacter = graphql<Response, InputProps>(HERO_QUERY, {
- export const withCharacter = graphql<Response>(HERO_QUERY, {
+ options: ({ episode }) => ({
+ variables: { episode },
- options: () => ({
- variables: { episode: "JEDI" },
import React from "react";
import ApolloClient, { createNetworkInterface } from "apollo-client";
import { ApolloProvider } from "react-apollo";
import Character from "./Character";
export const networkInterface = createNetworkInterface({
uri: "https://mpjk0plp9.lp.gql.zone/graphql",
});
export const client = new ApolloClient({ networkInterface });
export const withCharacter: OperationComponent<Response, InputProps> = graphql(HERO_QUERY, {
options: ({ episode }) => ({
// Operator '>' cannot be applied to types 'string' and 'number'.
variables: { episode: episode > 1 },
})
});
+ import { QueryProps } from "react-apollo";
+ export type Props = Response & QueryProps;
+ export const withCharacter = graphql<Response, InputProps, Props>(HERO_QUERY, {
- export const withCharacter = graphql<Response, InputProps>(HERO_QUERY, {
options: ({ episode }) => ({
variables: { episode },
}),
+ props: ({ data }) => ({ ...data }),
export const withCharacter = graphql<Response, InputProps, Props>(HERO_QUERY, {
options: ({ episode }) => ({
variables: { episode },
}),
props: ({ data, ownProps }) => ({
...data,
// Operator '>' cannot be applied to types 'string' and 'number'.
episode: ownProps.episode > 1,
// Property 'isHero' does not exist on type 'Hero'.
isHero: data && data.hero && data.hero.isHero,
Plugin 'VundleVim/Vundle.vim'
Plugin 'airblade/vim-gitgutter'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'austintaylor/vim-indentobject'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'rking/ag.vim'
Plugin 'garbas/vim-snipmate'
Plugin 'marcweber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
set nocompatible
syntax enable
colorscheme norma
let g:airline_theme='bubblegum'
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" ===============================================================
" norma
"
" URL:
" Author: jbaxleyiii
" License: MIT
" Last Change: 2016/11/03 00:26
" ===============================================================
let g:colors_name="norma"
# rebind prefix key
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
bind R source-file /home/jbaxleyiii/.tmux.conf \; display-message "tmux.conf reloaded"
set -g default-terminal "xterm-256color"
import { HERO_QUERY, withCharacter, Character, App } from '../App';
import {
empty,
hero_no_friends,
empty_array_friends,
friend_without_appearsIn,
} from './__mocks__/data';
// const mock = (hoc, props) => {