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
0
votes
1 answer

How to send custom headers to graphql server with relay?

I've seen the docs re injecting a new DefaultNetworkLayer, but I don't seem to be able to send custom headers. Here's my code: var headers = new Headers(); headers.append('Authorization', 'Basic hellotheretestheader'); Relay.injectNetworkLayer( …
jbrown
  • 5,873
  • 9
  • 56
  • 101
0
votes
1 answer

Injecting custom network url not working relayjs

I am following this sample app : https://github.com/relayjs/relay-starter-kit Relay.injectNetworkLayer( new Relay.DefaultNetworkLayer('http://localhost:8080/graphql') ); with custom url i am getting following errors OPTIONS…
invariant
  • 8,360
  • 9
  • 44
  • 58
-1
votes
1 answer

How to capture the response of a query in GraphQL Relay

I am new to relay, I have a query that delivers a response, which I can see in the network tab of the inspector, but what I dont understand is how to grab that response for use in my component. Could someone please explain that? My query is const…
IWI
  • 1,150
  • 1
  • 18
  • 35
-1
votes
1 answer

how to integrate routing(found-relay) in relay without its typings?

i want to create a web app in relay using found-relay routing. I looked at this sample in relay modern which i think is great: sample but i try tried to look at found-relay and I can't find @types/found-relay unlike @types/react-router-dom? i am…
gpbaculio
  • 3,649
  • 7
  • 31
  • 67
-1
votes
1 answer

react-select error: str.replace is not a function error

I am trying to implement react-select in my project. My code is here: https://gist.github.com/BikalNepal/9172b3161abfa545cc5748055c6584c6 The data for search is being fetched using graphql and relay from a backend nodejs server, when I type into…
Bikal Nepal
  • 367
  • 4
  • 18
-1
votes
1 answer

Relay re-fetching failed... error Relay was unable to reconcile edges on a connection

Help, plz! Perhaps someone already faced with my problem.... When re-fetch data with the updated variables -- using relay.setVariables() -- I get the error "Relay was unable to reconcile edges on a connection. This most likely occurred while trying…
-1
votes
1 answer

React relay tutorial undefined error

Why does: Uncaught TypeError: undefined is not a function show after completing and subsequently testing the tutorial?
obimod
  • 781
  • 9
  • 25
-2
votes
1 answer

Why 'handlePost' is not defined?

Try to add a handler to my Node, React button component, to insert a row in DB, but I got an error, though I am just copying code from an example tutorial. What is wrong?
János
  • 27,206
  • 24
  • 130
  • 270
-2
votes
1 answer

How to update root node such as viewer?

I'm trying to update the viewer field of the root node when user logs in with a UpdateUserSessionMutation. However since viewer starts as null and doesn't have an id initially, I'm not able to update the viewer field with the MutaitonPayload using…
Oguz Bilgic
  • 3,072
  • 5
  • 33
  • 55
-3
votes
1 answer

Relay - RelayQueryWriter: Unexpectedly encountered `undefined` in payload

I test relay, and I use relay-local-schema for test graph-ql request in client memory. All are good, and when the sendQueries method is called I fetch the good data. I can check this in debug. But after, I have this error message : RelayQueryWriter:…
juffblr
  • 5
  • 3
-3
votes
1 answer

What is a suitable backend for relayjs?

I am having trouble understanding how to hook up a backend that will support relayjs. Does GraphQL/Relay automatically help store queries? I.e. if I implement a REST backend that returns a json blob with everything, will Relay take care of the data…
user39664
  • 101
  • 1
  • 1
  • 3
1 2 3
45
46