Hiển thị các bài đăng có nhãn wpgraphql. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn wpgraphql. Hiển thị tất cả bài đăng

gatsby-source-graphql only shows 10 results

 https://stackoverflow.com/questions/63179173/gatsby-source-graphql-only-shows-10-results

I was experiencing the same issue with Graphql only returning the first 10 comments. I was able to get around this issue by specifying a first value in my query.

query {
    comments (first: 500) {
      ...
    }
}

The current GraphQL Edge schema likely has 10 as a default value for first.

wpgraphql: Node & Global ID

https://www.wpgraphql.com/docs/wpgraphql-concepts/ 

Every object in WordPress is treated as an individual "node" in GraphQL. Posts are nodes. Pages are nodes. Categories, tags, users, comments, menu items, etc are all considered "nodes".

And each "node" in the Graph can be identified by a unique ID.

In WordPress, IDs are not truly unique. There can be a Post with ID 1, a User with ID 1, a Category with ID 1 and a Comment with ID 1. WPGraphQL generates opaque global IDs for entities by hashing the underlying loader type and the database id. So, objects loaded by the Post loader get a global ID of base_64_encode( 'post:' . $database_id );. So, a Post with the database ID of 1 would have a global ID of cG9zdDox.

anti-pattern là gì

  Trong công nghệ và lập trình, Anti-pattern (mẫu phản diện) là những giải pháp bề ngoài có vẻ hiệu quả để giải quyết một vấn đề phổ biến, ...