Skip to content

Commit

Permalink
fix has_member #635
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Sep 19, 2020
1 parent 78ee576 commit d1cb8c0
Show file tree
Hide file tree
Showing 8 changed files with 219 additions and 57 deletions.
80 changes: 40 additions & 40 deletions app/graphql/schema.graphql

Large diffs are not rendered by default.

18 changes: 13 additions & 5 deletions app/graphql/types/funder_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ class FunderType < BaseObject
argument :affiliation_id, String, required: false
argument :organization_id, String, required: false
argument :registration_agency, String, required: false
argument :has_person, Boolean, required: false
argument :license, String, required: false
argument :resource_type, String, required: false
argument :language, String, required: false
argument :has_person, Boolean, required: false
argument :has_organization, Boolean, required: false
argument :has_affiliation, Boolean, required: false
argument :has_member, Boolean, required: false
argument :has_citations, Int, required: false
argument :has_parts, Int, required: false
argument :has_versions, Int, required: false
Expand All @@ -46,12 +47,13 @@ class FunderType < BaseObject
argument :affiliation_id, String, required: false
argument :organization_id, String, required: false
argument :registration_agency, String, required: false
argument :has_person, Boolean, required: false
argument :license, String, required: false
argument :resource_type, String, required: false
argument :language, String, required: false
argument :has_person, Boolean, required: false
argument :has_organization, Boolean, required: false
argument :has_affiliation, Boolean, required: false
argument :has_member, Boolean, required: false
argument :has_citations, Int, required: false
argument :has_parts, Int, required: false
argument :has_versions, Int, required: false
Expand All @@ -72,12 +74,13 @@ class FunderType < BaseObject
argument :affiliation_id, String, required: false
argument :organization_id, String, required: false
argument :registration_agency, String, required: false
argument :has_person, Boolean, required: false
argument :license, String, required: false
argument :resource_type, String, required: false
argument :language, String, required: false
argument :has_person, Boolean, required: false
argument :has_organization, Boolean, required: false
argument :has_affiliation, Boolean, required: false
argument :has_member, Boolean, required: false
argument :has_citations, Int, required: false
argument :has_parts, Int, required: false
argument :has_versions, Int, required: false
Expand All @@ -101,6 +104,10 @@ class FunderType < BaseObject
argument :resource_type, String, required: false
argument :license, String, required: false
argument :language, String, required: false
argument :has_person, Boolean, required: false
argument :has_organization, Boolean, required: false
argument :has_affiliation, Boolean, required: false
argument :has_member, Boolean, required: false
argument :has_citations, Int, required: false
argument :has_parts, Int, required: false
argument :has_versions, Int, required: false
Expand All @@ -123,11 +130,12 @@ class FunderType < BaseObject
argument :registration_agency, String, required: false
argument :resource_type_id, String, required: false
argument :resource_type, String, required: false
argument :has_person, Boolean, required: false
argument :license, String, required: false
argument :language, String, required: false
argument :has_person, Boolean, required: false
argument :has_organization, Boolean, required: false
argument :has_affiliation, Boolean, required: false
argument :has_member, Boolean, required: false
argument :has_citations, Int, required: false
argument :has_parts, Int, required: false
argument :has_versions, Int, required: false
Expand Down Expand Up @@ -187,6 +195,6 @@ def citation_count
end

def response(**args)
Doi.gql_query(args[:query], ids: args[:ids], funder_id: object.id, user_id: args[:user_id], client_id: args[:repository_id], provider_id: args[:member_id], affiliation_id: args[:affiliation_id], organization_id: args[:organization_id], resource_type_id: args[:resource_type_id], resource_type: args[:resource_type], agency: args[:registration_agency], language: args[:language], license: args[:license], has_person: args[:has_person], has_organization: args[:has_organization], has_affiliation: args[:has_affiliation], 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], field_of_science: args[:field_of_science], published: args[:published], state: "findable", page: { cursor: args[:after].present? ? Base64.urlsafe_decode64(args[:after]) : [], size: args[:first] })
Doi.gql_query(args[:query], ids: args[:ids], funder_id: object.id, user_id: args[:user_id], client_id: args[:repository_id], provider_id: args[:member_id], affiliation_id: args[:affiliation_id], organization_id: args[:organization_id], resource_type_id: args[:resource_type_id], resource_type: args[:resource_type], agency: args[:registration_agency], language: args[:language], license: args[:license], has_person: args[:has_person], has_organization: args[:has_organization], has_affiliation: args[:has_affiliation], has_member: args[:has_member], 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], field_of_science: args[:field_of_science], published: args[:published], state: "findable", page: { cursor: args[:after].present? ? Base64.urlsafe_decode64(args[:after]) : [], size: args[:first] })
end
end
25 changes: 25 additions & 0 deletions app/graphql/types/organization_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ class OrganizationType < BaseObject
argument :license, String, required: false
argument :resource_type, String, required: false
argument :language, String, required: false
argument :has_person, Boolean, required: false
argument :has_funder, Boolean, required: false
argument :has_organization, Boolean, required: false
argument :has_affiliation, Boolean, required: false
argument :has_member, Boolean, required: false
argument :has_citations, Int, required: false
argument :has_parts, Int, required: false
argument :has_versions, Int, required: false
Expand All @@ -61,6 +66,11 @@ class OrganizationType < BaseObject
argument :license, String, required: false
argument :resource_type, String, required: false
argument :language, String, required: false
argument :has_person, Boolean, required: false
argument :has_funder, Boolean, required: false
argument :has_organization, Boolean, required: false
argument :has_affiliation, Boolean, required: false
argument :has_member, Boolean, required: false
argument :has_citations, Int, required: false
argument :has_parts, Int, required: false
argument :has_versions, Int, required: false
Expand All @@ -83,6 +93,11 @@ class OrganizationType < BaseObject
argument :resource_type, String, required: false
argument :license, String, required: false
argument :language, String, required: false
argument :has_person, Boolean, required: false
argument :has_funder, Boolean, required: false
argument :has_organization, Boolean, required: false
argument :has_affiliation, Boolean, required: false
argument :has_member, Boolean, required: false
argument :has_citations, Int, required: false
argument :has_parts, Int, required: false
argument :has_versions, Int, required: false
Expand All @@ -105,6 +120,11 @@ class OrganizationType < BaseObject
argument :resource_type, String, required: false
argument :license, String, required: false
argument :language, String, required: false
argument :has_person, Boolean, required: false
argument :has_funder, Boolean, required: false
argument :has_organization, Boolean, required: false
argument :has_affiliation, Boolean, required: false
argument :has_member, Boolean, required: false
argument :has_citations, Int, required: false
argument :has_parts, Int, required: false
argument :has_versions, Int, required: false
Expand All @@ -127,6 +147,11 @@ class OrganizationType < BaseObject
argument :resource_type, String, required: false
argument :license, String, required: false
argument :language, String, required: false
argument :has_person, Boolean, required: false
argument :has_funder, Boolean, required: false
argument :has_organization, Boolean, required: false
argument :has_affiliation, Boolean, required: false
argument :has_member, Boolean, required: false
argument :has_citations, Int, required: false
argument :has_parts, Int, required: false
argument :has_versions, Int, required: false
Expand Down
Loading

0 comments on commit d1cb8c0

Please sign in to comment.