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 aboutMeImage from './about-me.png'; | |
// ... other code omitted for brevity | |
<ul> | |
<li> | |
<img src={aboutMeImage} height="40"/> | |
<span>About me</span> | |
</li> | |
</ul> |
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
ul { | |
list-style-type: none; | |
margin: 0; | |
padding: 0; | |
} | |
li { | |
display: flex; | |
justify-content: center; | |
align-items: center; |
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 from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import SiteNav, {ContentGroup} from 'react-site-nav'; | |
export default () => ( | |
<div className="App"> | |
<header className="App-header"> | |
<img src={logo} className="App-logo" alt="logo"/> | |
<h1 className="App-title">Welcome to React</h1> |
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 {withFlags} from 'ld-react'; | |
const Home = props => { | |
// flags are available via props.flags | |
return props.flags.devTestFlag ? <div>Flag on</div> : <div>Flag off</div>; | |
}; | |
export default withFlags(Home); |
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 {withFlagProvider} from 'ld-react'; | |
import Home from './home'; | |
const App = () => | |
<div> | |
<Home /> | |
</div>; | |
export default withFlagProvider(App, {clientSideId: 'your-client-side-id'}); |
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
<QueryRenderer | |
environment={relayEnvironment} | |
query={graphql` | |
query client_index_Query { | |
user { | |
name | |
favouritePlaces { | |
business { # look ma, remote schema field! | |
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
query { | |
business(where: {publicId: "$place.id"}) { # place.id is supplied by fragment on line 30 | |
id | |
name | |
address | |
} | |
} |
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
type Query { | |
user: User | |
place: Place | |
} | |
type User { | |
email: String | |
name: String | |
favouritePlaces: [Place] | |
} |
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 {mergeSchemas, makeRemoteExecutableSchema, makeExecutableSchema} from 'graphql-tools'; | |
import {importSchema} from 'graphql-import'; | |
import {HttpLink} from 'apollo-link-http'; | |
import fetch from 'node-fetch'; | |
import localSchema from './localSchema'; | |
const uri = 'https://eu1.prisma.sh/public-nickelwarrior-830/wendarie-prisma/dev'; | |
const link = new HttpLink({uri, fetch}); | |
// remote.schema.graphql is downloaded in the previous step |
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
schemaPath: ./remote.schema.graphql | |
extensions: | |
endpoints: | |
default: | |
url: https://eu1.prisma.sh/public-nickelwarrior-830/wendarie-prisma/dev |
NewerOlder