-
Currently it only shows 10 users. How do I increase this? And, how can I change the page I want to show users on eg: see page 1 with 30 users on it, or see page 2 with 30 users on it etc.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @Jonofat! Apologies for taking so long to reply to this! I hope you found your answer elsewhere in the meantime. Anyway, for other folks reading this, I thought it would be good to add some information here. When querying connections, you can pass arguments to specify how many items you would like from the data. In your case, you're asking for query MyQuery {
users(first:50) {
nodes {
lastName
firstName
userId
}
}
} The first argument accepts a number, and WPGraphQL will use that to determine how many nodes to return. WPGraphQL will cap at a max of 100 items by default. So, if you were to pass I've written an article about making paginated requests, with code examples here: https://www.wpgraphql.com/2020/03/26/forward-and-backward-pagination-with-wpgraphql/ |
Beta Was this translation helpful? Give feedback.
Hey @Jonofat!
Apologies for taking so long to reply to this! I hope you found your answer elsewhere in the meantime.
Anyway, for other folks reading this, I thought it would be good to add some information here.
When querying connections, you can pass arguments to specify how many items you would like from the data.
In your case, you're asking for
users
so if we wanted to ask for 50 users we could do that like so:The first argument accepts a number, and WPGraphQL will use that to determine how many nodes to return.
WPGraphQL will cap at a max of 100 items by default.
So, if you were to…