Sha256: 3a923e412f2a5df554227e9a91e4c27bd889249813491e02778deabb2308c5ea

Contents?: true

Size: 624 Bytes

Versions: 70

Compression:

Stored size: 624 Bytes

Contents

# frozen_string_literal: true

module GraphQL
  module Types
    module Relay
      module NodeBehaviors
        def self.included(child_module)
          child_module.extend(ClassMethods)
          child_module.description("An object with an ID.")
          child_module.field(:id, ID, null: false, description: "ID of the object.", resolver_method: :default_global_id)
        end

        def default_global_id
          context.schema.id_from_object(object, self.class, context)
        end

        module ClassMethods
          def default_relay?
            true
          end
        end
      end
    end
  end
end

Version data entries

70 entries across 70 versions & 1 rubygems

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