Slide 49
Slide 49 text
app/graph/graph/types/inspection.rb
module Graph
module Types
Inspection = GraphQL::ObjectType.define do
name 'Inspection'
description 'A NYC health inspection.'
global_id_field :id
field :type, types.String, 'The type of inspection.'
field :violationDescription, types.String, 'The violation description.', property: :violation_description
field :violationCode, types.String, 'The violation code cited.', property: :violation_code
field :grade, types.String, 'The grade received.'
field :score, types.Int, 'The numeric score received.'
field :inspectedAt, !types.String, 'The inspection timestamp.', property: :inspected_at
field :gradedAt, types.String, 'The issued grade timestamp.', property: :graded_at
end
end
end