Class: GraphQLSchema::Field
Instance Method Summary
collapse
Methods included from WithArgs
#args
#deprecated?, #deprecation_reason
Methods included from NamedHash
#camelize_name, #classify_name, #description, #name, #to_h, #upcase_name
Constructor Details
#initialize(field_hash) ⇒ Field
Returns a new instance of Field.
110
111
112
|
# File 'lib/graphql_schema.rb', line 110
def initialize(field_hash)
@hash = field_hash
end
|
Instance Method Details
#optional_args ⇒ Object
118
119
120
|
# File 'lib/graphql_schema.rb', line 118
def optional_args
@optional_args ||= args.reject{ |arg| arg.type.non_null? }
end
|
#required_args ⇒ Object
114
115
116
|
# File 'lib/graphql_schema.rb', line 114
def required_args
@required_args ||= args.select{ |arg| arg.type.non_null? }
end
|
#subfields? ⇒ Boolean
126
127
128
|
# File 'lib/graphql_schema.rb', line 126
def subfields?
type.subfields?
end
|
#type ⇒ Object
122
123
124
|
# File 'lib/graphql_schema.rb', line 122
def type
@type ||= TypeDeclaration.new(@hash.fetch('type'))
end
|