5
votes

Let's say I have some data that I obtained through a non-graphql endpoint for example from third party server (firebase).

How do I put the data into the local relay store? Is there an easy way to add / edit / overwrite data to relay store directly without going through query or mutation?

2
Did you find a way todo this?!James111

2 Answers

3
votes

A non public RelayStoreData field is accessible from the Relay.Store instance and it gives you direct access to the records contained in the store. I haven't done anything with this myself but you could try modifying the cache directly like this:

RelayStore._storeData._cachedStore._records[recordId][fieldName]=newValue

0
votes

I would use relay without a server, defining your graphql schema locally and doing your API requests from your graphql schema the same way you would query a database in your schema.

https://github.com/relay-tools/relay-local-schema