graph-client icon indicating copy to clipboard operation
graph-client copied to clipboard

Integration: relay

Open dotansimha opened this issue 2 years ago • 4 comments

dotansimha avatar Feb 28 '22 09:02 dotansimha

@n1ru4l what do you think about this one? Basically, the tooling we are building in this repo will eventually have a remote executable schema (mesh/tools executor) that we can use as Link/Exchange/fetch function/execute wrapper. How do you think this should be integrated with Relay? From my experience, I used https://github.com/relay-tools/react-relay-network-modern for managing the client network pipeline, but is there anything else we need to consider/support here?

dotansimha avatar Feb 28 '22 09:02 dotansimha

I neve used react-relay-network-modern before.

All that relay needs is basically a fetcher function.

import {
  Observable,
  GraphQLResponse,
  RequestParameters,
} from "relay-runtime";

type FetcherFunction = (
  request: RequestParameters,
  variables: Variables
) => Observable<GraphQLResponse>;

So that should be the interface we expose?

n1ru4l avatar Feb 28 '22 09:02 n1ru4l

All that relay needs is basically a fetcher function.

that's great! we already plan to expose raw fetch/execute functions, so it should be simple to integrate!

dotansimha avatar Feb 28 '22 09:02 dotansimha

Any progress on this?

youngkidwarrior avatar Oct 01 '23 21:10 youngkidwarrior