Skip to content

Commit

Permalink
fix connection queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 10, 2020
1 parent 3d84206 commit 0043a1d
Show file tree
Hide file tree
Showing 19 changed files with 345 additions and 325 deletions.
38 changes: 19 additions & 19 deletions app/graphql/types/audiovisual_connection_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ def years
end

def response(**args)
@response ||= Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
repository_id: args[:repository_id],
member_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "Audiovisual",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
client_id: args[:repository_id],
provider_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "Audiovisual",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
end
end
38 changes: 19 additions & 19 deletions app/graphql/types/collection_connection_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ def years
end

def response(**args)
@response ||= Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
repository_id: args[:repository_id],
member_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "Collection",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
client_id: args[:repository_id],
provider_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "Collection",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
end
end
38 changes: 19 additions & 19 deletions app/graphql/types/data_paper_connection_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ def years
end

def response(**args)
@response ||= Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
repository_id: args[:repository_id],
member_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "DataPaper",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
client_id: args[:repository_id],
provider_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "DataPaper",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
end
end
38 changes: 19 additions & 19 deletions app/graphql/types/dataset_connection_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@ def years
end

def response(**args)
@response ||= Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
repository_id: args[:repository_id],
member_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "Dataset",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
client_id: args[:repository_id],
provider_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "Dataset",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
end

def dataset_connection_count
Expand Down
38 changes: 19 additions & 19 deletions app/graphql/types/event_connection_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ def years
end

def response(**args)
@response ||= Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
repository_id: args[:repository_id],
member_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "Event",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
client_id: args[:repository_id],
provider_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "Event",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
end
end
38 changes: 19 additions & 19 deletions app/graphql/types/image_connection_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ def years
end

def response(**args)
@response ||= Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
repository_id: args[:repository_id],
member_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "Image",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
client_id: args[:repository_id],
provider_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "Image",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
end
end
40 changes: 20 additions & 20 deletions app/graphql/types/instrument_connection_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ def years
end

def response(**args)
@response ||= Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
repository_id: args[:repository_id],
member_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "Other",
resource_type: "Instrument",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
client_id: args[:repository_id],
provider_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "Other",
resource_type: "Instrument",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
end
end
38 changes: 19 additions & 19 deletions app/graphql/types/interactive_resource_connection_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@ def years
end

def response(**args)
@response ||= Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
repository_id: args[:repository_id],
member_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "InteractiveResource",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
Doi.query(args[:query],
ids: args[:ids],
user_id: args[:user_id],
client_id: args[:repository_id],
provider_id: args[:member_id],
funder_id: args[:funder_id],
affiliation_id: args[:affiliation_id],
re3data_id: args[:re3data_id],
year: args[:year],
resource_type_id: "InteractiveResource",
has_person: args[:has_person],
has_funder: args[:has_funder],
has_organization: args[:has_organization],
has_citations: args[:has_citations],
has_parts: args[:has_parts],
has_versions: args[:has_versions],
has_views: args[:has_views],
has_downloads: args[:has_downloads],
page: { number: 1, size: 0 })
end
end
2 changes: 1 addition & 1 deletion app/graphql/types/member_prefix_connection_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ def years
end

def response(**args)
@response ||= ProviderPrefix.query(args[:query], member_id: args[:member_id], state: args[:state], year: args[:year], page: { number: 1, size: 0 })
@response ||= ProviderPrefix.query(args[:query], provider_id: args[:member_id], state: args[:state], year: args[:year], page: { number: 1, size: 0 })
end
end
Loading

0 comments on commit 0043a1d

Please sign in to comment.