Module: GraphQR::Pagination
- Defined in:
- lib/graphqr/pagination.rb,
lib/graphqr/pagination/pagination_extension.rb,
lib/graphqr/pagination/resolvers/pagy_resolver.rb,
lib/graphqr/pagination/types/pagination_page_info_type.rb
Overview
This module adds the GraphQL pagination types.
When a field is paginated, the field ‘page_info` is always included with some pagination information.
To use this module use ‘extend GraphQR::Pagination` on the GraphQL::Schema::Object you want it, or in your `BaseObject`
Defined Under Namespace
Modules: Resolvers, Types Classes: PaginationExtension
Instance Method Summary collapse
Instance Method Details
#pagination_type ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/graphqr/pagination.rb', line 12 def pagination_type @pagination_type ||= begin conn_name = "#{graphql_name}Pagination" edge_type_class = edge_type Class.new(connection_type_class) do graphql_name(conn_name) edge_type(edge_type_class) field :page_info, Pagination::Types::PaginationPageInfoType, null: false, description: 'Information to aid in pagination.' end end end |