com.walmartlabs.lacinia.parser.schema

added in 0.22.0

Parse a Schema Definition Language document into a Lacinia input schema.

is-extension?

(is-extension? v)

parse-schema

(parse-schema schema-string)(parse-schema schema-string attach)

Given a GraphQL schema string, parses it and returns a Lacinia EDN schema. Defers validation of the schema to the downstream schema validator.

Directives may be declared and used, but validation of directives is also deferred downstream.

Most keys of the attach map are deprecated, but still supported. Documentation can now be provided inline in the schema document, and directives, streamers, and etc. can be added as needed via functions in the com.walmartlabs.lacinia.util namespace.

attach should be a map consisting of the following keys:

:federation enables support for GraphQL federation. It contains a sub-key, :entity-resolvers which maps from keyword entity name to an entity resolver function (or FieldResolver instance).

:resolvers (deprecated) is expected to be a map of: {:type-name {:field-name resolver-fn}}

:scalars (deprecated) is expected to be a map of: {:scalar-name {:parse parse-spec :serialize serialize-spec}}

A scalar map may also include a :description.

The provided scalar maps are merged into the scalars parsed from the document.

:streamers (deprecated) is expected to be a map of: {:type-name {:subscription-field-name stream-fn}}

:documentation (deprecated) is expected to be a map of: {:type-name doc-str :type-name/field-name doc-str :type-name/field-name.arg-name doc-str}