Skip to content

Commit

Permalink
use activerecord for graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed May 12, 2019
1 parent 2cb63d8 commit 7f53b7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/graphql/types/client_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ def prefixes(**args)
end

def datasets(**args)
Doi.query(args[:query], client_id: object.uid, resource_type_id: "Dataset", page: { number: 1, size: args[:first] })
Doi.query(args[:query], client_id: object.uid, resource_type_id: "Dataset", page: { number: 1, size: args[:first] }).records.to_a
end

def publications(**args)
Doi.query(args[:query], client_id: object.uid, resource_type_id: "Text", page: { number: 1, size: args[:first] })
Doi.query(args[:query], client_id: object.uid, resource_type_id: "Text", page: { number: 1, size: args[:first] }).records.to_a
end
end
2 changes: 1 addition & 1 deletion app/graphql/types/provider_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ def prefixes(**args)
end

def clients(**args)
Client.query(args[:query], provider_id: object.uid, year: args[:year], software: args[:software], page: { number: 1, size: 500 }).results.to_a
Client.query(args[:query], provider_id: object.uid, year: args[:year], software: args[:software], page: { number: 1, size: 500 }).records.to_a
end
end

0 comments on commit 7f53b7a

Please sign in to comment.