diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql index c52aa19a..6767bb08 100644 --- a/app/graphql/schema.graphql +++ b/app/graphql/schema.graphql @@ -1,7 +1,9 @@ type Assignment { createdAt: ISO8601DateTime! + endsOn: ISO8601Date id: ID! project: Project! + startsOn: ISO8601Date status: String! updatedAt: ISO8601DateTime! user: User! @@ -28,6 +30,11 @@ type Company { users: [User!]! } +""" +An ISO 8601-encoded date +""" +scalar ISO8601Date @specifiedBy(url: "https://tools.ietf.org/html/rfc3339") + """ An ISO 8601-encoded datetime """ diff --git a/app/graphql/types/staff_plan/assignment_type.rb b/app/graphql/types/staff_plan/assignment_type.rb index cdc0ec44..cc660a3e 100644 --- a/app/graphql/types/staff_plan/assignment_type.rb +++ b/app/graphql/types/staff_plan/assignment_type.rb @@ -7,6 +7,8 @@ class AssignmentType < Types::BaseObject field :user, Types::StaffPlan::UserType, null: false field :project, Types::StaffPlan::ProjectType, null: false field :status, String, null: false + field :starts_on, GraphQL::Types::ISO8601Date, null: true + field :ends_on, GraphQL::Types::ISO8601Date, null: true field :created_at, GraphQL::Types::ISO8601DateTime, null: false field :updated_at, GraphQL::Types::ISO8601DateTime, null: false