datacite/schnauzer

View on GitHub
app/graphql/types/data_catalog_connection_with_meta_type.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

class DataCatalogConnectionWithMetaType < BaseConnection
  edge_type(DataCatalogEdgeType)
  field_class GraphQL::Cache::Field
  
  field :total_count, Integer, null: true, cache: true

  def total_count
    args = object.arguments
    Repository.query(args[:query], page: { number: 1, size: 0 }).total
  end
end