From a5f4c759e313aa2ebb484fcf515655e001545076 Mon Sep 17 00:00:00 2001 From: "Anders D. Johnson" Date: Mon, 30 Mar 2020 06:08:57 -0500 Subject: [PATCH] --wip-- [skip ci] --- src/test/index.test.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/test/index.test.ts b/src/test/index.test.ts index a870959..3bfce4f 100644 --- a/src/test/index.test.ts +++ b/src/test/index.test.ts @@ -231,4 +231,19 @@ describe("fetchPaginate", () => { expect(result.items).toEqual(["one", "two", "three"]); }); }); + + describe("graphql", () => { + fetchPaginate("https://graphql.example.com", { + method: 'post', + body: ({ body }) => ({ + query: `query someQuery($page: Int = 1) { + products(page: $page) { + id + nextPage + } + }`, + variables: { page: body?.products?.nextPage }, + }), + }); + }); });