Skip to content

Commit

Permalink
change date type in GraphQL
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 13, 2020
1 parent d3a6caa commit ed7e461
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions app/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3406,7 +3406,7 @@ type Date {
"""
Date information for this resource
"""
date: ISO8601DateTime!
date: String!

"""
The type of date
Expand Down Expand Up @@ -5462,11 +5462,6 @@ An ISO 8601-encoded date
"""
scalar ISO8601Date

"""
An ISO 8601-encoded datetime
"""
scalar ISO8601DateTime

"""
Information about identifiers
"""
Expand Down
2 changes: 1 addition & 1 deletion app/graphql/types/date_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
class DateType < BaseObject
description "Information about dates"

field :date, GraphQL::Types::ISO8601DateTime, null: false, description: "Date information for this resource"
field :date, String, null: false, description: "Date information for this resource"
field :date_type, String, null: true, hash_key: "dateType", description: "The type of date"
end
2 changes: 1 addition & 1 deletion spec/graphql/types/date_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
subject { described_class }

it { is_expected.to have_field(:dateType).of_type("String") }
it { is_expected.to have_field(:date).of_type("ISO8601DateTime!") }
it { is_expected.to have_field(:date).of_type("String!") }
end
end

0 comments on commit ed7e461

Please sign in to comment.