Sha256: d34d5da632b72137cea060b07f74756cfa2289d4f02994b5ff94d3fd908a3f5a

Contents?: true

Size: 1.63 KB

Versions: 70

Compression:

Stored size: 1.63 KB

Contents

# frozen_string_literal: true

module GraphQL
  module Types
    module Relay
      # Use this to implement Relay connections, or take it as inspiration
      # for Relay classes in your own app.
      #
      # You may wish to copy this code into your own base class,
      # so you can extend your own `BaseObject` instead of `GraphQL::Schema::Object`.
      #
      # @example Implementation a connection and edge
      #   class BaseObject < GraphQL::Schema::Object; end
      #
      #   # Given some object in your app ...
      #   class Types::Post < BaseObject
      #   end
      #
      #   # Make a couple of base classes:
      #   class Types::BaseEdge < GraphQL::Types::Relay::BaseEdge; end
      #   class Types::BaseConnection < GraphQL::Types::Relay::BaseConnection; end
      #
      #   # Then extend them for the object in your app
      #   class Types::PostEdge < Types::BaseEdge
      #     node_type Types::Post
      #   end
      #
      #   class Types::PostConnection < Types::BaseConnection
      #     edge_type Types::PostEdge,
      #               edges_nullable: true,
      #               edge_nullable: true,
      #               node_nullable: true,
      #               nodes_field: true
      #
      #     # Alternatively, you can call the class methods followed by your edge type
      #     # edges_nullable true
      #     # edge_nullable true
      #     # node_nullable true
      #     # has_nodes_field true
      #     # edge_type Types::PostEdge
      #   end
      #
      # @see Relay::BaseEdge for edge types
      class BaseConnection < Schema::Object
        include ConnectionBehaviors
      end
    end
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
graphql-2.4.8 lib/graphql/types/relay/base_connection.rb
graphql-2.4.7 lib/graphql/types/relay/base_connection.rb
graphql-2.4.6 lib/graphql/types/relay/base_connection.rb
graphql-2.4.5 lib/graphql/types/relay/base_connection.rb
graphql-2.4.4 lib/graphql/types/relay/base_connection.rb
graphql-2.4.3 lib/graphql/types/relay/base_connection.rb
graphql-2.4.2 lib/graphql/types/relay/base_connection.rb
graphql-2.4.1 lib/graphql/types/relay/base_connection.rb
graphql-2.4.0 lib/graphql/types/relay/base_connection.rb
graphql-2.3.20 lib/graphql/types/relay/base_connection.rb
graphql-2.3.19 lib/graphql/types/relay/base_connection.rb
graphql-2.3.18 lib/graphql/types/relay/base_connection.rb
graphql-2.3.17 lib/graphql/types/relay/base_connection.rb
graphql-2.3.16 lib/graphql/types/relay/base_connection.rb
graphql-2.3.15 lib/graphql/types/relay/base_connection.rb
graphql-2.3.14 lib/graphql/types/relay/base_connection.rb
graphql-2.3.13 lib/graphql/types/relay/base_connection.rb
graphql-2.3.12 lib/graphql/types/relay/base_connection.rb
graphql-2.3.11 lib/graphql/types/relay/base_connection.rb
graphql-2.3.10 lib/graphql/types/relay/base_connection.rb