Git Product home page Git Product logo

graphql-kaminari_connection's People

Contributors

matsu911 avatar umekawa avatar yuku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

graphql-kaminari_connection's Issues

Method :object raise error in resolve_field_method

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

`

Failed to implement errors

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?

using root type instead of field

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.