in a previous video we showed how you
can have a graph QL query returned
multiple records and we showed how we
can use the get many customers query to
return all of the records where the
country was USA and if we look at our
result over here we see that basically
we've returned quite a few records so
let's say that we only would like to see
the first five records so I'll go here
and I'll say fetch sorry first and then
I'll type in say five and then we'll go
ahead and execute that and just to make
it a little bit easier to read I'm going
to remove the orders query so if I run
it now we can see here are our first
five customers customer one two three
four five and now we want to go we might
want to go and fetch say the next page
of records but before we try to do that
we'd like to know is there in fact
another page of records so we can do
that by returning additional information
from this query so right now we've
returned records which specifies which
fields we'd like to return but there's
also another object called page info
that we can use and this has a property
called has next page so we'll go ahead
there and run this and we can see now
that the first five records are returned
but there is a additional property that
says has next page but we also need to
specify that we'd like to get one
additional property out of the query
called a cursor so we'll go ahead there
and run that and now we can see that
each record has a cursor and now now
that we have this cursor we can use that
to specify the starting point of our
next query so let's go ahead now and use
this cursor value which is the cursor
value for this record Loa and EP so I'm
going to go here and say that I would
like to start my query so I'm gonna go
this Orion type in
occur and if I execute this I should get
the next five records starting with L o
ne P so go there and you can see there's
ello any P which is the first record and
here all the curse of values and we
still have another new page but we don't
want to basically CL o ne PS the first
record because that was the last record
on the previous page so we'll go here
and we'll say skip one skip color on one
and then we'll go ahead and run this
sorry
made a mistake there fix that so you can
see now we've skipped over that l o and
EP on the second page and we still have
another page of records so we'll go
there now and we'll type our cursor
value in and we'll run this now and you
can see now we basically get in the or
we're on the third page now and we only
have three records on this page and
there is the has next page property is
set to false so what we've shown now is
how you can use the get many queries to
return data to return multiple records
from a table and how you can paginate
the results
Customer Support