Skip to content

Commit

Permalink
only show findable dois.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed May 10, 2019
1 parent d0791fb commit 9059b8d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
3 changes: 3 additions & 0 deletions app/graphql/lupo_schema.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# frozen_string_literal: true

class LupoSchema < GraphQL::Schema
default_max_page_size 100
max_depth 5

# mutation(Types::MutationType)
query(Types::QueryType)
end
30 changes: 15 additions & 15 deletions app/graphql/types/query_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def organization(id:)
end

def datasets(query: nil, first: nil)
Doi.query(query, resource_type_id: "Dataset", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "Dataset", state: "findable", page: { number: 1, size: first })
end

field :dataset, DatasetType, null: false do
Expand All @@ -124,7 +124,7 @@ def dataset(id:)
end

def publications(query: nil, first: nil)
Doi.query(query, resource_type_id: "Text", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "Text", state: "findable", page: { number: 1, size: first })
end

field :publication, PublicationType, null: false do
Expand All @@ -142,7 +142,7 @@ def publication(id:)
end

def audiovisuals(query: nil, first: nil)
Doi.query(query, resource_type_id: "Audiovisual", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "Audiovisual", state: "findable", page: { number: 1, size: first })
end

field :audiovisual, AudiovisualType, null: false do
Expand All @@ -160,7 +160,7 @@ def audiovisual(id:)
end

def collections(query: nil, first: nil)
Doi.query(query, resource_type_id: "Collection", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "Collection", state: "findable", page: { number: 1, size: first })
end

field :collection, CollectionType, null: false do
Expand All @@ -178,7 +178,7 @@ def collection(id:)
end

def data_papers(query: nil, first: nil)
Doi.query(query, resource_type_id: "DataPaper", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "DataPaper", state: "findable", page: { number: 1, size: first })
end

field :data_paper, DataPaperType, null: false do
Expand All @@ -196,7 +196,7 @@ def data_paper(id:)
end

def events(query: nil, first: nil)
Doi.query(query, resource_type_id: "Event", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "Event", state: "findable", page: { number: 1, size: first })
end

field :event, EventType, null: false do
Expand All @@ -214,7 +214,7 @@ def event(id:)
end

def images(query: nil, first: nil)
Doi.query(query, resource_type_id: "Image", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "Image", state: "findable", page: { number: 1, size: first })
end

field :image, ImageType, null: false do
Expand All @@ -232,7 +232,7 @@ def image(id:)
end

def interactive_resources(query: nil, first: nil)
Doi.query(query, resource_type_id: "InteractiveResource", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "InteractiveResource", state: "findable", page: { number: 1, size: first })
end

field :interactive_resource, InteractiveResourceType, null: false do
Expand All @@ -250,7 +250,7 @@ def interactive_resource(id:)
end

def models(query: nil, first: nil)
Doi.query(query, resource_type_id: "Model", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "Model", state: "findable", page: { number: 1, size: first })
end

field :model, ModelType, null: false do
Expand All @@ -268,7 +268,7 @@ def model(id:)
end

def physical_objects(query: nil, first: nil)
Doi.query(query, resource_type_id: "PhysicalObject", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "PhysicalObject", state: "findable", page: { number: 1, size: first })
end

field :physical_object, PhysicalObjectType, null: false do
Expand All @@ -286,7 +286,7 @@ def physical_object(id:)
end

def services(query: nil, first: nil)
Doi.query(query, resource_type_id: "Service", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "Service", state: "findable", page: { number: 1, size: first })
end

field :service, ServiceType, null: false do
Expand All @@ -304,7 +304,7 @@ def service(id:)
end

def softwares(query: nil, first: nil)
Doi.query(query, resource_type_id: "Software", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "Software", state: "findable", page: { number: 1, size: first })
end

field :software, SoftwareType, null: false do
Expand All @@ -322,7 +322,7 @@ def software(id:)
end

def sounds(query: nil, first: nil)
Doi.query(query, resource_type_id: "Sound", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "Sound", state: "findable", page: { number: 1, size: first })
end

field :sound, SoundType, null: false do
Expand All @@ -340,7 +340,7 @@ def sound(id:)
end

def workflows(query: nil, first: nil)
Doi.query(query, resource_type_id: "Workflow", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "Workflow", state: "findable", page: { number: 1, size: first })
end

field :workflow, WorkflowType, null: false do
Expand All @@ -358,7 +358,7 @@ def workflow(id:)
end

def others(query: nil, first: nil)
Doi.query(query, resource_type_id: "Other", page: { number: 1, size: first })
Doi.query(query, resource_type_id: "Other", state: "findable", page: { number: 1, size: first })
end

field :other, OtherType, null: false do
Expand Down

0 comments on commit 9059b8d

Please sign in to comment.