You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/graphql/scalar_type.rb
+24-1Lines changed: 24 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,28 @@
1
1
moduleGraphQL
2
-
# The parent type for scalars, eg {GraphQL::STRING_TYPE}, {GraphQL::INT_TYPE}
2
+
# # GraphQL::ScalarType
3
+
#
4
+
# Scalars are plain values. They are leaf nodes in a GraphQL query tree.
5
+
#
6
+
# ## Built-in Scalars
7
+
#
8
+
# `GraphQL` comes with standard built-in scalars:
9
+
#
10
+
# Constant | `.define` helper
11
+
# =========|==================
12
+
# `GraphQL::STRING_TYPE` | `types.String`
13
+
# `GraphQL::INT_TYPE` | `types.Int`
14
+
# `GraphQL::FLOAT_TYPE` | `types.Float`
15
+
# `GraphQL::ID_TYPE` | `types.ID`
16
+
# `GraphQL::BOOLEAN_TYPE` | `types.Boolean`
17
+
#
18
+
# (`types` is an instance of `GraphQL::Definition::TypeDefiner`; `.String`, `.Float`, etc are methods which return built-in scalars.)
19
+
#
20
+
# ## Custom Scalars
21
+
#
22
+
# You can define custom scalars for your GraphQL server. It requires some special functions:
23
+
#
24
+
# - `coerce_input` is used to prepare incoming values for GraphQL execution. (Incoming values come from variables or literal values in the query string.)
25
+
# - `coerce_result` is used to turn Ruby values _back_ into serializable values for query responses.
0 commit comments