summaryrefslogtreecommitdiff
path: root/app/graphql/types/snippets/blob_connection_type.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/types/snippets/blob_connection_type.rb')
-rw-r--r--app/graphql/types/snippets/blob_connection_type.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/graphql/types/snippets/blob_connection_type.rb b/app/graphql/types/snippets/blob_connection_type.rb
new file mode 100644
index 00000000000..15d26af7374
--- /dev/null
+++ b/app/graphql/types/snippets/blob_connection_type.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+module Types
+ module Snippets
+ # rubocop: disable Graphql/AuthorizeTypes
+ class BlobConnectionType < GraphQL::Types::Relay::BaseConnection
+ field :has_unretrievable_blobs, GraphQL::Types::Boolean, null: false,
+ description: 'Indicates if the snippet has unretrievable blobs.',
+ resolver_method: :unretrievable_blobs?
+
+ def unretrievable_blobs?
+ !!context[:unretrievable_blobs?]
+ end
+ end
+ end
+end