Class: Types::Packages::MetadataType

Inherits:
BaseUnion
  • Object
show all
Defined in:
app/graphql/types/packages/metadata_type.rb

Class Method Summary collapse

Methods inherited from BaseUnion

authorized?

Class Method Details

.resolve_type(object, context) ⇒ Object


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/graphql/types/packages/metadata_type.rb', line 11

def self.resolve_type(object, context)
  case object
  when ::Packages::Composer::Metadatum
    ::Types::Packages::Composer::MetadatumType
  when ::Packages::Conan::Metadatum
    ::Types::Packages::Conan::MetadatumType
  when ::Packages::Maven::Metadatum
    ::Types::Packages::Maven::MetadatumType
  when ::Packages::Nuget::Metadatum
    ::Types::Packages::Nuget::MetadatumType
  when ::Packages::Pypi::Metadatum
    ::Types::Packages::Pypi::MetadatumType
  else
    # NOTE: This method must be kept in sync with `PackageWithoutVersionsType#metadata`,
    # which must never produce data that this discriminator cannot handle.
    raise 'Unsupported metadata type'
  end
end