Welcome to mirror list, hosted at ThFree Co, Russian Federation.

time_type.rb « types « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2333d82ad1ed7e0567afddfa71742ca7583d6de6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Types
  class TimeType < BaseScalar
    graphql_name 'Time'
    description 'Time represented in ISO 8601'

    def self.coerce_input(value, ctx)
      Time.parse(value)
    end

    def self.coerce_result(value, ctx)
      value.iso8601
    end
  end
end