From 7f53b7aa3a87d5edb9a0441bcbed2741c8ee8446 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 13 May 2019 01:01:24 +0200 Subject: [PATCH] use activerecord for graphql --- app/graphql/types/client_type.rb | 4 ++-- app/graphql/types/provider_type.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/graphql/types/client_type.rb b/app/graphql/types/client_type.rb index dff81b3e9..63edfbc87 100644 --- a/app/graphql/types/client_type.rb +++ b/app/graphql/types/client_type.rb @@ -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 diff --git a/app/graphql/types/provider_type.rb b/app/graphql/types/provider_type.rb index d349a78af..46becc91d 100644 --- a/app/graphql/types/provider_type.rb +++ b/app/graphql/types/provider_type.rb @@ -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