Skip to content

Commit

Permalink
keep required researcher_type. datacite/volpino#72
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Sep 30, 2019
1 parent c10e1f4 commit 24996a8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions app/graphql/types/researcher_type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

class ResearcherType < BaseObject
description "Information about researchers"

field :id, ID, null: true, description: "ORCID ID"
field :name, String, null: true, description: "Researcher name"
field :name_type, String, null: true, hash_key: "nameType", description: "The type of name"
field :given_names, String, null: true, description: "User given names"
field :family_name, String, null: true, description: "Researcher family name"

def id
object.uid ? "https://orcid.org/#{object.uid}" : object.id
end

def name
object.name
end
end

0 comments on commit 24996a8

Please sign in to comment.