Skip to content

Commit 0a6921d

Browse files
committed
Add extra documentation on base scalars
1 parent 76f8a35 commit 0a6921d

File tree

1 file changed

+45
-9
lines changed

1 file changed

+45
-9
lines changed

docs/types/scalars.rst

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,54 @@ Base scalars
3030

3131
Graphene defines the following base Scalar Types:
3232

33-
- ``graphene.String``
34-
- ``graphene.Int``
35-
- ``graphene.Float``
36-
- ``graphene.Boolean``
37-
- ``graphene.ID``
33+
``graphene.String``
34+
35+
Represents textual data, represented as UTF-8
36+
character sequences. The String type is most often used by GraphQL to
37+
represent free-form human-readable text.
38+
39+
``graphene.Int``
40+
41+
Represents non-fractional signed whole numeric
42+
values. Int can represent values between `-(2^53 - 1)` and `2^53 - 1` since
43+
represented in JSON as double-precision floating point numbers specified
44+
by `IEEE 754 <http://en.wikipedia.org/wiki/IEEE_floating_point>`_.
45+
46+
``graphene.Float``
47+
48+
Represents signed double-precision fractional
49+
values as specified by
50+
`IEEE 754 <http://en.wikipedia.org/wiki/IEEE_floating_point>`_.
51+
52+
``graphene.Boolean``
53+
54+
Represents `true` or `false`.
55+
56+
``graphene.ID``
57+
58+
Represents a unique identifier, often used to
59+
refetch an object or as key for a cache. The ID type appears in a JSON
60+
response as a String; however, it is not intended to be human-readable.
61+
When expected as an input type, any string (such as `"4"`) or integer
62+
(such as `4`) input value will be accepted as an ID.
3863

3964
Graphene also provides custom scalars for Dates, Times, and JSON:
4065

41-
- ``graphene.types.datetime.Date``
42-
- ``graphene.types.datetime.DateTime``
43-
- ``graphene.types.datetime.Time``
44-
- ``graphene.types.json.JSONString``
66+
``graphene.types.datetime.Date``
67+
68+
Represents a Date value as specified by `iso8601 <https://en.wikipedia.org/wiki/ISO_8601>`_.
69+
70+
``graphene.types.datetime.DateTime``
71+
72+
Represents a DateTime value as specified by `iso8601 <https://en.wikipedia.org/wiki/ISO_8601>`_.
73+
74+
``graphene.types.datetime.Time``
75+
76+
Represents a Time value as specified by `iso8601 <https://en.wikipedia.org/wiki/ISO_8601>`_.
77+
78+
``graphene.types.json.JSONString``
79+
80+
Represents a JSON string.
4581

4682

4783
Custom scalars

0 commit comments

Comments
 (0)