Resolver generation for Git database adapter.
Generates Pathom resolvers per identity attribute:
Pathom 2 is the default. Pathom 3 is opt-in via generate-resolvers-pathom3
and is loaded lazily, so pathom3 is never a hard dependency of this library
(mirrors com.fulcrologic.rad.database-adapters.datomic).
Resolver generation for Git database adapter. Generates Pathom resolvers per identity attribute: 1. ID resolver — fetch entity by ID (read EDN file) 2. All-IDs resolver — list all entities of a type (list directory) Pathom 2 is the default. Pathom 3 is opt-in via `generate-resolvers-pathom3` and is loaded lazily, so pathom3 is never a hard dependency of this library (mirrors com.fulcrologic.rad.database-adapters.datomic).
Active resolver constructor. Defaults to Pathom 2; rebind to
make-pathom3-resolver for Pathom 3 output. See generate-resolvers and
generate-resolvers-pathom3.
Active resolver constructor. Defaults to Pathom 2; rebind to `make-pathom3-resolver` for Pathom 3 output. See `generate-resolvers` and `generate-resolvers-pathom3`.
(all-ids-resolver all-attributes
{:com.fulcrologic.rad.attributes/keys [qualified-key schema]
:as id-attribute})Generate a resolver that returns all entity IDs of a type. For directory entities, lists subdirectories. For recursive entities, uses list-entities-recursive. Otherwise lists flat files.
Generate a resolver that returns all entity IDs of a type. For directory entities, lists subdirectories. For recursive entities, uses list-entities-recursive. Otherwise lists flat files.
(child-id-resolver all-attributes
{:com.fulcrologic.rad.attributes/keys [qualified-key schema]
:as child-id-attribute}
output-attributes
{:keys [parent-id-key child-dir]}
key->attribute)Generate a batch resolver for scoped child entities with compound input. Input: [parent-id-key child-id-key]. Output: child attributes. Reads: repo-dir/parent-entity-dir/parent-id/child-dir/child-id.ext
Generate a batch resolver for scoped child entities with compound input. Input: [parent-id-key child-id-key]. Output: child attributes. Reads: repo-dir/parent-entity-dir/parent-id/child-dir/child-id.ext
(generate-resolvers attributes schema)Generate all Pathom 2 resolvers for the given git-backed schema (the default).
Produces ID, all-IDs, ref, and scoped child-ID resolvers. Register the result with your Pathom 2 parser.
Arguments:
Returns: sequence of Pathom 2 resolver maps.
Generate all Pathom 2 resolvers for the given git-backed schema (the default). Produces ID, all-IDs, ref, and scoped child-ID resolvers. Register the result with your Pathom 2 parser. Arguments: - attributes: collection of RAD attributes - schema: schema keyword (e.g. :knowledge) Returns: sequence of Pathom 2 resolver maps.
(generate-resolvers-pathom3 attributes schema)Generate all resolvers as Pathom 3 resolvers. Requires pathom3 on the
classpath (loaded lazily). Register the result with pci/register.
Same shape as generate-resolvers, but each element is a pathom3
Resolver produced by com.wsscode.pathom3.connect.operation/resolver.
Generate all resolvers as Pathom 3 resolvers. Requires pathom3 on the classpath (loaded lazily). Register the result with `pci/register`. Same shape as `generate-resolvers`, but each element is a pathom3 Resolver produced by `com.wsscode.pathom3.connect.operation/resolver`.
(id-resolver all-attributes
{:com.fulcrologic.rad.attributes/keys [qualified-key schema]
:as id-attribute}
output-attributes)Generate a batch resolver that fetches entities by ID. For directory entities (::gto/directory? true), reads the index file inside the entity subdirectory instead of a flat file.
Generate a batch resolver that fetches entities by ID. For directory entities (::gto/directory? true), reads the index file inside the entity subdirectory instead of a flat file.
(make-pathom2-resolver resolve-sym {:keys [input output batch?]} resolve-fn)Build a Pathom 2 resolver as a plain map keyed by :com.wsscode.pathom.connect/*.
No hard dependency on pathom2 — just namespaced keywords.
config = {:input [...] :output ... :batch? bool}.
Build a Pathom 2 resolver as a plain map keyed by :com.wsscode.pathom.connect/*.
No hard dependency on pathom2 — just namespaced keywords.
`config` = {:input [...] :output ... :batch? bool}.(make-pathom3-resolver resolve-sym {:keys [input output batch?]} resolve-fn)Build a Pathom 3 resolver via lazy-invoke of pco/resolver. Requires pathom3 on
the classpath at call time. config = {:input [...] :output ... :batch? bool}.
Build a Pathom 3 resolver via lazy-invoke of pco/resolver. Requires pathom3 on
the classpath at call time. `config` = {:input [...] :output ... :batch? bool}.(ref-resolver {:keys [ref-attr ref-key parent-id-key child-id-key child-dir]}
key->attribute)Generate a resolver that lists child entities via directory listing. Input: parent identity. Output: ref attribute with child idents. Lists files in: repo-dir/parent-entity-dir/parent-id/child-dir/
Generate a resolver that lists child entities via directory listing. Input: parent identity. Output: ref attribute with child idents. Lists files in: repo-dir/parent-entity-dir/parent-id/child-dir/
(resolver-fn resolver)Extract the resolve function from a generated resolver, regardless of whether it is a Pathom 2 map or a Pathom 3 Resolver record.
Extract the resolve function from a generated resolver, regardless of whether it is a Pathom 2 map or a Pathom 3 Resolver record.
(source-file-resolver
{:com.fulcrologic.rad.attributes/keys [qualified-key schema] :as id-attribute}
source-file
output-attributes)Generate a batch resolver for a group of attributes that share a source-file. Reads a named file inside a directory entity. Only for directory entities. source-file: the explicit filename (e.g. "summary.edn").
Generate a batch resolver for a group of attributes that share a source-file. Reads a named file inside a directory entity. Only for directory entities. source-file: the explicit filename (e.g. "summary.edn").
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |