From ed7e461c1da7edcfb804cadf2f559682e165403d Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 13 Apr 2020 08:49:29 +0200 Subject: [PATCH] change date type in GraphQL --- app/graphql/schema.graphql | 7 +------ app/graphql/types/date_type.rb | 2 +- spec/graphql/types/date_type_spec.rb | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql index 37072cf20..07dade305 100644 --- a/app/graphql/schema.graphql +++ b/app/graphql/schema.graphql @@ -3406,7 +3406,7 @@ type Date { """ Date information for this resource """ - date: ISO8601DateTime! + date: String! """ The type of date @@ -5462,11 +5462,6 @@ An ISO 8601-encoded date """ scalar ISO8601Date -""" -An ISO 8601-encoded datetime -""" -scalar ISO8601DateTime - """ Information about identifiers """ diff --git a/app/graphql/types/date_type.rb b/app/graphql/types/date_type.rb index 48ebe890e..728fa7fcb 100644 --- a/app/graphql/types/date_type.rb +++ b/app/graphql/types/date_type.rb @@ -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 diff --git a/spec/graphql/types/date_type_spec.rb b/spec/graphql/types/date_type_spec.rb index 0920af426..928ccbdad 100644 --- a/spec/graphql/types/date_type_spec.rb +++ b/spec/graphql/types/date_type_spec.rb @@ -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