alumbra.generators

operation

(operation schema & [opts])

Create a function that can be called with an operation type (e.g. :query, :mutation, :subscription) and, optionally, the desired name of the operation, and will produce an operation matching the given analyzed schema.

(def schema
  (alumbra.analyzer/analyze-schema
    "type Person { ... } ... "
    alumbra.parser/parse-schema))

(def gen-operation
  (operation schema))

(gen/sample (gen-operation :query))
(gen/sample (gen-operation :query "MyQueryName"))

schema must conform to :alumbra/analyzed-schema (see alumbra.spec).

raw-document

(raw-document)

Create a generator for a random (i.e. not semantically sound) GraphQL query document.

raw-schema

(raw-schema)

Create a generator for a random (i.e. not semantically sound) GraphQL schema document.