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
"configurations": [ | |
{ | |
"name": "Jest", // This is the configuration name you will see in debug sidebar | |
"type": "node", | |
"request": "launch", | |
"port": 5858, | |
"address": "localhost", | |
"stopOnEntry": false, | |
"runtimeExecutable": null, | |
"env": { |
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 type { TodoListQueryType } from './__generated__/TodoListQueryType'; | |
class TodoList extends React.Component { | |
list: $PropertyType<TodoListQueryType, 'list'> | |
constructor(props: TodoListQueryType) { | |
list = props.list | |
... | |
} | |
} |
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 type { TodoListQueryType } from './__generated__/TodoListQueryType'; | |
class TodoList extends React.Component { | |
constructor(props: TodoListQueryType) { | |
... | |
} | |
} |
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
class TodoItem extends React.Component { | |
render() { | |
const item = this.props.item; | |
// ... | |
} | |
} | |
export default createFragmentContainer( | |
TodoItem, | |
item: graphql` |
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
class TodoList extends React.Component { | |
render() { | |
return ( | |
<QueryRenderer | |
environment={environment} | |
query={graphql` | |
query TodoListQuery { | |
list { | |
# Specify any fields required by '<TodoList>' itself. | |
title |
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 { QueryRenderer, graphql } from 'react-relay'; | |
class Example extends React.Component { | |
render() { | |
return ( | |
<QueryRenderer | |
environment={environment} | |
query={graphql` | |
query ExampleQuery($pageID: 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
{ | |
"data": { | |
"hero": { | |
"name": "R2-D2", | |
"friends": [ | |
{ | |
"name": "Luke Skywalker" | |
}, | |
{ | |
"name": "Han Solo" |
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
{ | |
"episode": "JEDI" | |
} |
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
query HeroNameAndFriends($episode: Episode) { | |
hero(episode: $episode) { | |
name | |
friends { | |
name | |
} | |
} | |
} |
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
// @flow | |
type MyObject = { | |
foo: number, | |
bar: boolean, | |
baz: string, | |
}; | |
var val: MyObject = { /* ... */ }; | |
function method(val: MyObject) { /* ... */ } | |
class Foo { constructor(val: MyObject) { /* ... */ } } |
NewerOlder