Mechanisms for executing parsed queries against compiled schemas.
Mechanisms for executing parsed queries against compiled schemas.
(execute-query context)
Entrypoint for execution of a query.
Expects the context to contain the schema and parsed query.
Returns a ResolverResult that will deliver the result map.
This should generally not be invoked by user code; see [[execute-parsed-query]].
Entrypoint for execution of a query. Expects the context to contain the schema and parsed query. Returns a ResolverResult that will deliver the result map. This should generally not be invoked by user code; see [[execute-parsed-query]].
(invoke-streamer context source-stream)
Given a parsed and prepared query (inside the context, as with execute-query
),
this will locate the streamer for a subscription
and invoke it, passing it the context, the subscription arguments, and the source stream.
Given a parsed and prepared query (inside the context, as with [[execute-query]]), this will locate the streamer for a subscription and invoke it, passing it the context, the subscription arguments, and the source stream.
(selections-seq context)
A width-first traversal of selections tree, returning a lazy sequence of qualified field names. A qualified field name is a namespaced keyword, the namespace is the containing type, e.g. :User/name.
A width-first traversal of selections tree, returning a lazy sequence of qualified field names. A qualified field name is a namespaced keyword, the namespace is the containing type, e.g. :User/name.
(selections-tree context)
Constructs a tree of the selections below the current field.
Returns a map where the keys are qualified field names (the selections for this field). The value is a vector of maps with three optional keys; :args, :alias, and :selections. :args is the arguments that will be passed to that field's resolver. :selections is the nested selection tree. :alias is the alias for the field (most fields do not have aliases).
A vector is returned because the selection for an outer field may, via aliases, reference the same inner field multiple times (with different arguments and/or sub-selections).
Each key of a nested map is present only if a value is provided; for scalar fields with no arguments, the nested map will be nil.
Fragments are flattened into containing fields, as with selections-seq
.
Constructs a tree of the selections below the current field. Returns a map where the keys are qualified field names (the selections for this field). The value is a vector of maps with three optional keys; :args, :alias, and :selections. :args is the arguments that will be passed to that field's resolver. :selections is the nested selection tree. :alias is the alias for the field (most fields do not have aliases). A vector is returned because the selection for an outer field may, via aliases, reference the same inner field multiple times (with different arguments and/or sub-selections). Each key of a nested map is present only if a value is provided; for scalar fields with no arguments, the nested map will be nil. Fragments are flattened into containing fields, as with `selections-seq`.
(selects-field? context field-name)
Invoked by a field resolver to determine if a particular field is selected anywhere within the selection tree (that is, at any depth).
Invoked by a field resolver to determine if a particular field is selected anywhere within the selection tree (that is, at any depth).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close