Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 1787

Rescript Relay connecting mutation with refechable pagination

$
0
0

I use examples from tutorial (mutation step 4). In my example I use “composer”:

module AlbumRelayComposerFragment = %relay(`
  fragment AlbumRelayComposerFragment on Viewer {
    __id
  }
`)

I use it in Fragment module, and in code I get the connection like this:

  let {data: albumsRef, refetch} = Fragment.usePagination(viewerRef.viewer.fragmentRefs)
  let album_nodes = albumsRef.albums->Fragment.getConnectionNodes
  let (addAlbum, isAddingAlbum) = AddMutation.use()

  let {__id} = AlbumRelayComposerFragment.use(albumsRef.fragmentRefs)
  let connectionId = RescriptRelay.ConnectionHandler.getConnectionID(
    __id,
    "AlbumRelayAlbumsSection_albums",
    (),
  )

It’s a bet but because I use AlbumRelayComposerFragment.use I guess it’s not updated when pagination is refetched.
I can’t see how in my case connection is related to filter :thinking:
I don’t have repro at the moment but I can push it later today.


Viewing all articles
Browse latest Browse all 1787

Trending Articles