Skip to content

Instantly share code, notes, and snippets.

View kfarst's full-sized avatar

Kevin Farst kfarst

View GitHub Profile
"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": {
import type { TodoListQueryType } from './__generated__/TodoListQueryType';
class TodoList extends React.Component {
list: $PropertyType<TodoListQueryType, 'list'>
constructor(props: TodoListQueryType) {
list = props.list
...
}
}
import type { TodoListQueryType } from './__generated__/TodoListQueryType';
class TodoList extends React.Component {
constructor(props: TodoListQueryType) {
...
}
}
class TodoItem extends React.Component {
render() {
const item = this.props.item;
// ...
}
}
export default createFragmentContainer(
TodoItem,
item: graphql`
class TodoList extends React.Component {
render() {
return (
<QueryRenderer
environment={environment}
query={graphql`
query TodoListQuery {
list {
# Specify any fields required by '<TodoList>' itself.
title
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!) {
{
"data": {
"hero": {
"name": "R2-D2",
"friends": [
{
"name": "Luke Skywalker"
},
{
"name": "Han Solo"
{
"episode": "JEDI"
}
query HeroNameAndFriends($episode: Episode) {
hero(episode: $episode) {
name
friends {
name
}
}
}
// @flow
type MyObject = {
foo: number,
bar: boolean,
baz: string,
};
var val: MyObject = { /* ... */ };
function method(val: MyObject) { /* ... */ }
class Foo { constructor(val: MyObject) { /* ... */ } }