Skip to content

How do I change the number of users I can display? #1862

Answered by jasonbahl
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

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:

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…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jasonbahl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Type: Question Further information is requested scope: docs Affects external, user-facing documentation. ObjectType: User Component: Pagination
1 participant