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.
(parsed-query->context parsed-query)
Converts a parsed query, prior to execution, into a context compatible with preview API:
This is used to preview the execution of the query prior to execution.
Converts a parsed query, prior to execution, into a context compatible with preview API: * [[selections-tree]] * [[selects-field?]] * [[selections-seq]] This is used to preview the execution of the query prior to execution.
(selections-seq context)
A width-first traversal of the 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.
Fragments are flattened (as if always selected).
A width-first traversal of the 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. Fragments are flattened (as if always selected).
(selections-seq2 context)
An enhancement of selections-seq
that returns a map for each node:
:name : The qualified field name
:args : The arguments of the field (if any)
:alias : The alias for the field, if any
An enhancement of [[selections-seq]] that returns a map for each node: :name : The qualified field name :args : The arguments of the field (if any) :alias : The alias for the field, if any
(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, aliases, 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, aliases, 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