class GraphqlGrpc::InputTypeLibrary

Constants

PREFIX

Public Instance Methods

build_descriptors(some_types) click to toggle source
# File lib/graphql_grpc/type_library.rb, line 236
def build_descriptors(some_types)
  super
  # Edge case: remove any input types with empty sub_types, such
  # as is the case when a google.protobuf.Empty object is declared
  # as the argument for a gRPC call that is being mapped to a
  # GraphQL query.
  @descriptors.delete_if do |_key, descriptor|
    if descriptor.name.start_with?('google.protobuf') &&
       descriptor.respond_to?(:sub_types) &&
       descriptor.sub_types.empty?
      true
    else
      false
    end
  end
end
type_prefix() click to toggle source
# File lib/graphql_grpc/type_library.rb, line 232
def type_prefix
  PREFIX
end