This repository was archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 787
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove previous examples * initial SSR example with meteor * prettier files * cleaned up flow typed * added flow example * tweak ssr example * added typescript example * start work on multi project runner * added tests using current test utilities * add testing to SSR example and change flow to base * remove reports * updated base app and removed flow code * prettied base files * fix travis file
- Loading branch information
James Baxley
authored
Jul 31, 2017
1 parent
9697f4e
commit a17394b
Showing
175 changed files
with
8,455 additions
and
22,712 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "flow", | ||
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"apollo-client": "^1.9.0-1", | ||
"graphql-tag": "^2.4.2", | ||
"react": "^15.6.1", | ||
"react-apollo": "file:../..", | ||
"react-dom": "^15.6.1", | ||
"react-scripts": "1.0.10" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"test": "react-scripts test --env=jsdom", | ||
"eject": "react-scripts eject" | ||
}, | ||
"devDependencies": {} | ||
} |
File renamed without changes.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"short_name": "React App", | ||
"name": "Create React App Sample", | ||
"icons": [ | ||
{ | ||
"src": "favicon.ico", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
} | ||
], | ||
"start_url": "./index.html", | ||
"display": "standalone", | ||
"theme_color": "#000000", | ||
"background_color": "#ffffff" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React from 'react'; | ||
import { graphql } from 'react-apollo'; | ||
import gql from 'graphql-tag'; | ||
|
||
export const HERO_QUERY = gql` | ||
query GetCharacter($episode: Episode!) { | ||
hero(episode: $episode) { | ||
name | ||
id | ||
friends { | ||
name | ||
id | ||
appearsIn | ||
} | ||
} | ||
} | ||
`; | ||
|
||
export const withCharacter = graphql(HERO_QUERY, { | ||
options: ({ episode }) => ({ | ||
variables: { episode }, | ||
}), | ||
props: ({ data }) => ({ ...data }), | ||
}); | ||
|
||
export const CharacterWithoutData = ({ loading, hero, error }) => { | ||
if (loading) return <div>Loading</div>; | ||
if (error) return <h1>ERROR</h1>; | ||
return ( | ||
<div> | ||
{hero && | ||
<div> | ||
<h3> | ||
{hero.name} | ||
</h3> | ||
|
||
{hero.friends && | ||
hero.friends.map( | ||
friend => | ||
friend && | ||
<h6 key={friend.id}> | ||
{friend.name}:{' '} | ||
{friend.appearsIn.map(x => x && x.toLowerCase()).join(', ')} | ||
</h6>, | ||
)} | ||
</div>} | ||
</div> | ||
); | ||
}; | ||
|
||
export const Character = withCharacter(CharacterWithoutData); | ||
|
||
export const App = () => | ||
<div> | ||
<Character episode="NEWHOPE" /> | ||
</div>; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
export const empty = null; | ||
|
||
export const hero_no_friends = { | ||
__typename: 'Droid', | ||
name: 'r2d2', | ||
id: '1', | ||
friends: null, | ||
}; | ||
|
||
export const empty_array_friends = { | ||
...hero_no_friends, | ||
...{ | ||
friends: [null], | ||
}, | ||
}; | ||
|
||
export const friend_without_appearsIn = { | ||
...hero_no_friends, | ||
...{ | ||
friends: [ | ||
{ name: 'luke', id: '2', appearsIn: ['NEWHOPE'] }, | ||
{ name: 'james', id: '777', appearsIn: [null] }, | ||
], | ||
}, | ||
}; | ||
|
||
export const full = { | ||
...hero_no_friends, | ||
...{ | ||
friends: [{ name: 'luke', id: '2', appearsIn: ['NEWHOPE'] }], | ||
}, | ||
}; |
Oops, something went wrong.