graphql-extras 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/graphql/extras/types.rb +17 -2
- data/lib/graphql/extras/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a587f57b312930a4acbc2e05a5085e88ad87091e63071a84e4a2dc44d9579e1
|
4
|
+
data.tar.gz: 70e3df8ee4eaf5aad6ebda59d82cabf1bdb003e2b1cf71c34dd091246dd4363c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cda336492a615c8df70e3d1093f2820fef1ffc3bbd246e7c0e2f501f710c325ec72fb7ceb9ef61d5f842ebf9b7318706b0763eb85fd2d6363160888194cec5e3
|
7
|
+
data.tar.gz: 1b69edd0f8ed98069bf9f07c019b62cddd6272eda5dfdc7c729a5c49d0017e6da742dcf1ec366f48f449f528fcb9720cb96468a497ec4df534b8e6844bcf2905
|
data/lib/graphql/extras/types.rb
CHANGED
@@ -6,10 +6,19 @@ module GraphQL
|
|
6
6
|
module Extras
|
7
7
|
module Types
|
8
8
|
class DateTime < GraphQL::Types::ISO8601DateTime
|
9
|
+
description <<~DESC
|
10
|
+
The `DateTime` scalar type represents a date and time in the UTC
|
11
|
+
timezone. The DateTime appears in a JSON response as an ISO8601 formatted
|
12
|
+
string, including UTC timezone ("Z"). The parsed date and time string will
|
13
|
+
be converted to UTC and any UTC offset other than 0 will be rejected.
|
14
|
+
DESC
|
9
15
|
end
|
10
16
|
|
11
17
|
class Date < GraphQL::Schema::Scalar
|
12
|
-
description
|
18
|
+
description <<~DESC
|
19
|
+
The `Date` scalar type represents a date. The Date appears in a JSON
|
20
|
+
response as an ISO8601 formatted string.
|
21
|
+
DESC
|
13
22
|
|
14
23
|
def self.coerce_input(value, _context)
|
15
24
|
::Date.iso8601(value)
|
@@ -23,7 +32,11 @@ module GraphQL
|
|
23
32
|
end
|
24
33
|
|
25
34
|
class Decimal < GraphQL::Schema::Scalar
|
26
|
-
description
|
35
|
+
description <<~DESC
|
36
|
+
The `Decimal` scalar type represents signed double-precision fractional
|
37
|
+
values parsed by the `Decimal` library. The Decimal appears in a JSON
|
38
|
+
response as a string to preserve precision.
|
39
|
+
DESC
|
27
40
|
|
28
41
|
def self.coerce_input(value, _context)
|
29
42
|
BigDecimal(value.to_s)
|
@@ -37,6 +50,8 @@ module GraphQL
|
|
37
50
|
end
|
38
51
|
|
39
52
|
class Upload < GraphQL::Schema::Scalar
|
53
|
+
description "Represents an uploaded file."
|
54
|
+
|
40
55
|
def self.coerce_input(value, context)
|
41
56
|
return nil if value.nil?
|
42
57
|
|