GraphqlMarkdown.Backlinks (Graphql Markdown v1.2.0)

Copy Markdown View Source

Reverse index of type references: for every named type, the operations that return it and the types and operations that use it in a field or an argument.

Built once per render from a GraphqlMarkdown.Schema and looked up while rendering type entries, when the :backlinks option is set.

Summary

Types

An operation (by section and name) or a type referencing the indexed type.

t()

Functions

Builds the index. Operations come in schema order, types in section order.

The references to name, or empty lists when nothing refers to it.

Types

entry()

@type entry() :: %{returned_by: [ref()], used_by: [ref()]}

ref()

@type ref() :: {:operation, String.t(), String.t()} | {:type, map()}

An operation (by section and name) or a type referencing the indexed type.

t()

@type t() :: %{required(String.t()) => entry()}

Functions

index(schema_details)

@spec index(GraphqlMarkdown.Schema.t()) :: t()

Builds the index. Operations come in schema order, types in section order.

lookup(index, name)

@spec lookup(t(), String.t()) :: entry()

The references to name, or empty lists when nothing refers to it.