increments / graphql-kaminari_connection Goto Github PK
View Code? Open in Web Editor NEWKaminari based GraphQL pagination
License: MIT License
Kaminari based GraphQL pagination
License: MIT License
I'm using graphql ruby 1.8 and it raise error with method object
` field :page_data, page_data_type_class, null: false, method: :object
field :items, [type_class], 'A list of items', null: false, method: :object
`
With the following query
bars(page: $page, per: $per) {
pageData {
currentPage
isFirstPage
isLastPage
isOutOfRange
limitValue
nextPage
prevPage
totalPages
}
items {
fullName
}
}
}
Seeing both
Failed to implement BarPage.pageData
and
Failed to implement BarPage.items
after following the usage instructions, furthermore, when i dump the schema, it appears to have added things:
bars(page: Int, per: Int): BarPage!
Autogenerated page type for BarPage
"""
type BarPage {
"""
A list of items
"""
items: [Bar!]!
pageData: PageData!
}```
Any ideas what's missing?
Now, rspec was failed when Ruby v3.0 (or v3.1).
https://github.com/increments/graphql-kaminari_connection/actions/runs/3336267614/jobs/5521212459
Hi there
Is there a way to cover this case?
field :organizations, resolver: Queries::Organizations::Organization
resolver:
module Queries
module Organizations
class Organization < BaseQuery
description "Returns Organizations"
type Types::Organizations::OrganizationType.kaminari_connection
def resolve(page: nil, per: nil)
query = MyQuery
query.all.page(page).per(per)
end
end
end
end
Type definition:
module Types
module Organizations
class OrganizationType < Types::BaseObject
include KaminariConnection
field :id, ID
end
end
end
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.