Responsible for constructing and validating the GraphQL schema.
GraphQL schema starts in a format easy to read and maintain as an EDN file.
Compiling the schema performs a number of validations and reorganizations to make query execution faster and simpler, such as generating a flatter structure for the schema, and pre-computing many defaults.
Responsible for constructing and validating the GraphQL schema. GraphQL schema starts in a format easy to read and maintain as an EDN file. Compiling the schema performs a number of validations and reorganizations to make query execution faster and simpler, such as generating a flatter structure for the schema, and pre-computing many defaults.
If bound to true, then the compiled schema prints and pretty-prints like an ordinary map, which is sometimes useful during development. When false (the default) the schema output is just a placeholder.
If bound to true, then the compiled schema prints and pretty-prints like an ordinary map, which is sometimes useful during development. When false (the default) the schema output is just a placeholder.
(as-conformer f)
Creates a clojure.spec/conformer as a wrapper around the supplied function.
The function is only invoked if the value to be conformed is non-nil.
Any exception thrown by the function is silently caught and the returned conformer
will return :clojure.spec/invalid or a coercion-failure
.
This function has been deprecated, as Scalar parse and serialize callbacks are now simple functions, and not conformers.
Creates a clojure.spec/conformer as a wrapper around the supplied function. The function is only invoked if the value to be conformed is non-nil. Any exception thrown by the function is silently caught and the returned conformer will return :clojure.spec/invalid or a [[coercion-failure]]. This function has been deprecated, as Scalar parse and serialize callbacks are now simple functions, and not conformers.
(coercion-failure message)
(coercion-failure message data)
Returns a special record that indicates a failure coercing a scalar value. This may be returned from a scalar's :parse or :serialize callback.
A coercion failure includes a message key, and may also include additional data.
message : A message string presentable to a user.
data : An optional map of additional details about the failure.
Returns a special record that indicates a failure coercing a scalar value. This may be returned from a scalar's :parse or :serialize callback. A coercion failure includes a message key, and may also include additional data. message : A message string presentable to a user. data : An optional map of additional details about the failure.
(compile schema)
(compile schema options)
Compiles an schema, verifies its correctness, and prepares it for query execution. The compiled schema is in an entirely different format than the input schema.
The format of the compiled schema is subject to change without notice.
This function explicitly validates its arguments using clojure.spec.
Compile options:
:default-field-resolver
: A function that accepts a field name (as a keyword) and converts it into the
default field resolver; this defaults to default-field-resolver
.
Produces a form ready for use in executing a query.
Compiles an schema, verifies its correctness, and prepares it for query execution. The compiled schema is in an entirely different format than the input schema. The format of the compiled schema is subject to change without notice. This function explicitly validates its arguments using clojure.spec. Compile options: :default-field-resolver : A function that accepts a field name (as a keyword) and converts it into the default field resolver; this defaults to [[default-field-resolver]]. Produces a form ready for use in executing a query.
(default-field-resolver field-name)
The default for the :default-field-resolver option, this uses the field name as the key into the resolved value.
The default for the :default-field-resolver option, this uses the field name as the key into the resolved value.
(hyphenating-default-field-resolver field-name)
An alternative to default-field-resolver
, this converts underscores in the field name
into hyphens. At one time, this was the default behavior.
An alternative to [[default-field-resolver]], this converts underscores in the field name into hyphens. At one time, this was the default behavior.
(is-coercion-failure? v)
Is this a coercion error created by coercion-failure
?
Is this a coercion error created by [[coercion-failure]]?
(tag-with-type x type-name)
Tags a value with a GraphQL type name, a keyword. The keyword should identify a specific concrete object (not an interface or union) in the relevent schema.
In most cases, this is accomplished by modifying the value's metadata.
For the more rare case, where a particular type is used rather than a Clojure map, this function returns a new wrapper instance that combines the value and the type name.
Tags a value with a GraphQL type name, a keyword. The keyword should identify a specific concrete object (not an interface or union) in the relevent schema. In most cases, this is accomplished by modifying the value's metadata. For the more rare case, where a particular type is used rather than a Clojure map, this function returns a new wrapper instance that combines the value and the type name.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close