-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Martin Fenner
committed
Jan 26, 2020
1 parent
8a72165
commit 9ff0244
Showing
16 changed files
with
172 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
app/graphql/types/provider_client_connection_with_meta_type.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
class ProviderClientConnectionWithMetaType < BaseConnection | ||
edge_type(ClientEdgeType) | ||
field_class GraphQL::Cache::Field | ||
|
||
field :total_count, Integer, null: false, cache: true | ||
|
||
def total_count | ||
args = object.arguments | ||
|
||
Client.query(args[:query], provider_id: object.parent.uid, year: args[:year], software: args[:software], page: { number: 1, size: 0 }).results.total | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require "rails_helper" | ||
|
||
describe ClientType do | ||
describe "fields" do | ||
subject { described_class } | ||
|
||
it { is_expected.to have_field(:id).of_type(!types.ID) } | ||
it { is_expected.to have_field(:type).of_type("String!") } | ||
it { is_expected.to have_field(:name).of_type("String!") } | ||
it { is_expected.to have_field(:alternateName).of_type("String") } | ||
it { is_expected.to have_field(:description).of_type("String") } | ||
it { is_expected.to have_field(:datasets).of_type("ClientDatasetConnectionWithMeta!") } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# require "rails_helper" | ||
|
||
# describe DataCatalogType do | ||
# describe "fields" do | ||
# subject { described_class } | ||
|
||
# it { is_expected.to have_field(:id).of_type(!types.ID) } | ||
# it { is_expected.to have_field(:type).of_type("String!") } | ||
# # it { is_expected.to have_field(:name).of_type("[Person!]") } | ||
# # it { is_expected.to have_field(:alternateName).of_type("[Title!]") } | ||
# # it { is_expected.to have_field(:description).of_type("Int") } | ||
# # it { is_expected.to have_field(:certicates).of_type("String") } | ||
# # it { is_expected.to have_field(:subjects).of_type("String") } | ||
# # it { is_expected.to have_field(:datasets).of_type("String") } | ||
# end | ||
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require "rails_helper" | ||
|
||
describe DatasetType do | ||
describe "fields" do | ||
subject { described_class } | ||
|
||
it { is_expected.to have_field(:id).of_type(!types.ID) } | ||
it { is_expected.to have_field(:type).of_type("String!") } | ||
it { is_expected.to have_field(:datasets).of_type("DatasetDatasetConnectionWithMeta!") } | ||
it { is_expected.to have_field(:publications).of_type("DatasetPublicationConnectionWithMeta!") } | ||
it { is_expected.to have_field(:softwareSourceCodes).of_type("DatasetSoftwareConnectionWithMeta!") } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require "rails_helper" | ||
|
||
describe FunderType do | ||
describe "fields" do | ||
subject { described_class } | ||
|
||
it { is_expected.to have_field(:id).of_type(!types.ID) } | ||
it { is_expected.to have_field(:type).of_type("String!") } | ||
it { is_expected.to have_field(:name).of_type("String!") } | ||
it { is_expected.to have_field(:alternateName).of_type("[String!]") } | ||
it { is_expected.to have_field(:datasets).of_type("FunderDatasetConnectionWithMeta!") } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require "rails_helper" | ||
|
||
describe ProviderType do | ||
describe "fields" do | ||
subject { described_class } | ||
|
||
it { is_expected.to have_field(:id).of_type(!types.ID) } | ||
it { is_expected.to have_field(:type).of_type("String!") } | ||
it { is_expected.to have_field(:name).of_type("String!") } | ||
it { is_expected.to have_field(:displayName).of_type("String") } | ||
it { is_expected.to have_field(:description).of_type("String") } | ||
it { is_expected.to have_field(:clients).of_type("ProviderClientConnectionWithMeta!") } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require "rails_helper" | ||
|
||
describe PublicationType do | ||
describe "fields" do | ||
subject { described_class } | ||
|
||
it { is_expected.to have_field(:id).of_type(!types.ID) } | ||
it { is_expected.to have_field(:type).of_type("String!") } | ||
it { is_expected.to have_field(:datasets).of_type("PublicationDatasetConnectionWithMeta!") } | ||
it { is_expected.to have_field(:publications).of_type("PublicationPublicationConnectionWithMeta!") } | ||
it { is_expected.to have_field(:softwareSourceCodes).of_type("PublicationSoftwareConnectionWithMeta!") } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require "rails_helper" | ||
|
||
describe SoftwareType do | ||
describe "fields" do | ||
subject { described_class } | ||
|
||
it { is_expected.to have_field(:id).of_type(!types.ID) } | ||
it { is_expected.to have_field(:type).of_type("String!") } | ||
it { is_expected.to have_field(:datasets).of_type("SoftwareDatasetConnectionWithMeta!") } | ||
it { is_expected.to have_field(:publications).of_type("SoftwarePublicationConnectionWithMeta!") } | ||
it { is_expected.to have_field(:softwareSourceCodes).of_type("SoftwareSoftwareConnectionWithMeta!") } | ||
end | ||
end |