Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/juffalow/react-relay-example

Example project how to use React, Relay and TypeScript
https://github.com/juffalow/react-relay-example

example-project graphql react react-bootstrap react-helmet react-router relay typescript

Last synced: 21 days ago
JSON representation

Example project how to use React, Relay and TypeScript

Awesome Lists containing this project

README

        

# React + Relay Example

List of Quotes with Authors implemented in React + Relay.

*You can use either [PHP](https://github.com/juffalow/slim-graphql-eloquent-example) or [Node](https://github.com/juffalow/express-graphql-example) as a backend.*

## How to run the project

#### Installation

```shell
yarn install

# or if you use npm

npm install
```

#### Configuration

Create `src/config.ts` or rename `src/config.example.ts` and make sure it contains your server's graphql endpoint url:

```js
export default {
graphql: 'http://localhost:3013/graphql',
};
```

#### Download GraphQL schema

For this, you need to have [graphql-cli](https://github.com/graphql-cli/graphql-cli) installed.

```shell
graphql get-schema --project quotes -e default
```

Build / transform components which are using graphql / relay

```shell
yarn run relay
```

#### Start the project

```shell
yarn start
```

## Old version

This version is using older Relay version `10.0.1`:
* [1.2.3](https://github.com/juffalow/react-relay-example/tree/1.2.3)

Working version of React + Relay application written in JavaScript:
* [1.0.0](https://github.com/juffalow/react-relay-example/tree/1.0.0)

## License

[MIT license](./LICENSE)