Questions tagged [relayjs]

Relay is a JavaScript framework for building data-driven React applications

Declarative: Never again communicate with your data store using an imperative API. Simply declare your data requirements using GraphQL and let Relay figure out how and when to fetch your data.

Colocation: Queries live next to the views that rely on them, so you can easily reason about your app. Relay aggregates queries into efficient network requests to fetch only what you need.

Mutations: Relay lets you mutate data on the client and server using GraphQL mutations, and offers automatic data consistency, optimistic updates, and error handling.

Resources

Code: https://github.com/facebook/relay
Docs: https://facebook.github.io/relay/
Chat: https://reactiflux.slack.com/messages/relay/ (Get an invite here)

686 questions
172
votes
6 answers

What is the difference between Falcor and GraphQL?

GraphQL consists of a type system, query language and execution semantics, static validation, and type introspection, each outlined below. To guide you through each of these components, we've written an example designed to illustrate the…
Gajus
  • 55,791
  • 58
  • 236
  • 384
53
votes
1 answer

In Relay, what role do the node interface and the global ID spec play?

I started out with the relay-starter-kit and also worked my way through the Relay and GraphQL documentation. But there are quite a few areas that are unexplained and mysterious. Seriously I read a lot of documentations everywhere about all these…
Christine
  • 2,998
  • 1
  • 18
  • 33
53
votes
1 answer

When should I use a Relay GraphQL connection and when a plain list?

In Relay GraphQL, connections and lists are both array-like, but they have different features. When should I use each?
wincent
  • 4,437
  • 19
  • 22
46
votes
1 answer

How to type an exported RelayContainer

I'm trying to type (with flowtype) the components I'm enhancing with Relay.createContainer. I looked into the types exported by the "react-relay" package but ReactContainer doesn't seem to carry over Props. I experimented with RelayContainer,…
chollier
  • 892
  • 1
  • 7
  • 8
40
votes
1 answer

Difference between : Redux and Relay

I have read number of articles/docs based on redux and relay but still I am confused how this two libraries are different? What are the advantages and downsides of this this two libraries? What is the exact role of GraphQL in relay? Which is the…
Sachin
  • 2,121
  • 9
  • 26
  • 49
36
votes
2 answers

How to handle local state when using relay?

I am working on a react/relay-based content management system. Users can create and modify articles, which are stored on the server. I was wondering what the best way is, to handle the modified state of the article before it is saved to the server.…
danielbuechele
  • 2,974
  • 2
  • 15
  • 28
36
votes
2 answers

What do 3 dots/periods/ellipsis in a relay/graphql query mean?

The relay docs contain this fragment: query RebelsRefetchQuery { node(id: "RmFjdGlvbjox") { id ... on Faction { name } } } What does this ... on Faction on syntax mean?
jbrown
  • 5,873
  • 9
  • 56
  • 101
28
votes
1 answer

Relay vs Redux vs Apollo with GraphQL and React-Native

I have to start a new (web + native) project (mid-size app) from scratch. Due to the plethora of JS frameworks and implementation out there especially in the last couple of years, I have been having a second doubt on my usual stack. I have been…
zaq
  • 2,355
  • 8
  • 29
  • 66
27
votes
2 answers

What is the meaning of viewer field in GraphQL?

What is the purpose of root query field viewer in GraphQL? Based on this article, viewer could be used to accept a token parameter so we can see who is currently logged in. How should I implement it?
Sibelius Seraphini
  • 4,023
  • 7
  • 30
  • 52
21
votes
2 answers

Testing strategy on Relay + React

I am experimenting with React + Relay + Graphql these days. Unfortunately, I cannot find any easy and convenient way to test React component wrapped by Relay Container. Basically, I would like to achieve these goals along TDD, Render a container…
user2741411
  • 213
  • 2
  • 4
16
votes
2 answers

Augment react-router module with react-router-relay typings

The default react-router is used as such: import * as React from 'react'; import { Router, Route, hashHistory } from 'react-router'; const routing = (
Peeter
  • 8,952
  • 4
  • 34
  • 52
16
votes
5 answers

How would you do file uploads in a React-Relay app?

A file upload seems like a mutation. It's often accompanied by other data. But it's a big binary blob, so I'm not sure how GraphQL can deal with it. How would you integrate file uploads into an app built with Relay?
Nick Retallack
  • 17,432
  • 17
  • 85
  • 110
15
votes
5 answers

Authentication and privileges on Relay/GraphQL

Facebook does not mention authentication for their GraphQL library. Suppose I have a users table fetchable from GraphQL and I do not wish to disclose users information to anybody who demands it except the logged in user, at what level should I add…
Lyes BEN
  • 940
  • 4
  • 13
15
votes
3 answers

Authentication and Access Control with Relay

The official line from Facebook is that Relay is "intentionally agnostic about authentication mechanisms." In all the examples in the Relay repository, authentication and access control are a separate concern. In practice, I have not found a simple…
Dmitry Minkovsky
  • 30,036
  • 20
  • 97
  • 138
14
votes
0 answers

Can Relay and Redux work together?

And if they can what are the ways to integrate them? Some (anti)patterns? I have invested some time in learning both of them but still can't figure out the way to leverage both of them (with their strong points) in a single application.
Alexander Reshytko
  • 1,683
  • 1
  • 15
  • 24
1
2 3
45 46