From 8bbc5fed37035192d0efe202ab4ecda04ce79cac Mon Sep 17 00:00:00 2001 From: Panagiotis Karatakis Date: Wed, 12 Oct 2022 21:58:40 +0300 Subject: [PATCH] Update Readme --- README.md | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 17ec6174..46721216 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,8 @@ Go to http://localhost:8000/ and try out the following queries: ```graphql { - film(pagination: { limit: 10, page: 0 }, orderBy: { title: ASC }) { - data { + film(pagination: { pages: { limit: 10, page: 0 } }, orderBy: { title: ASC }) { + nodes { title description releaseYear @@ -79,7 +79,7 @@ Go to http://localhost:8000/ and try out the following queries: ```graphql { store(filters: { storeId: { eq: 1 } }) { - data { + nodes { storeId address { address @@ -98,8 +98,11 @@ Go to http://localhost:8000/ and try out the following queries: ```graphql { - customer(filters: { active: { eq: 0 } }, pagination: { page: 2, limit: 3 }) { - data { + customer( + filters: { active: { eq: 0 } } + pagination: { pages: { page: 2, limit: 3 } } + ) { + nodes { customerId lastName email @@ -110,6 +113,28 @@ Go to http://localhost:8000/ and try out the following queries: } ``` +### The query above using cursor pagination + +```graphql +{ + customer( + filters: { active: { eq: 0 } } + pagination: { cursor: { limit: 3, cursor: "Int[3]:271" } } + ) { + nodes { + customerId + lastName + email + } + pageInfo { + hasPreviousPage + hasNextPage + endCursor + } + } +} +``` + ### Postgres Setup the [sakila](https://github.com/SeaQL/seaography/blob/main/examples/postgres/sakila-schema.sql) sample database.