View Source GraphqlMarkdown.MarkdownHelpers (Graphql Markdown v0.5.0)

A set of helpers to generate proper markdown easily

Summary

Functions

Generates a code block for a GraphQL operation. Only the top-level fields returned are represented in the code block. When one of the fields returned is an object, the object's fields are not included in the code block.

Functions

Link to this function

anchor(text, anchor_text \\ nil)

View Source
@spec anchor(String.t(), String.t() | nil) :: String.t()
@spec code(String.t()) :: String.t()
Link to this function

default_value(defaultValue)

View Source
@spec default_value(any()) :: String.t()
Link to this function

graphql_operation_code_block(operation_details)

View Source

Generates a code block for a GraphQL operation. Only the top-level fields returned are represented in the code block. When one of the fields returned is an object, the object's fields are not included in the code block.

Example:

  mutation RefreshIdToken($refreshToken: String!) {
    refreshIdToken(refreshToken: $refreshToken) {
      idToken
      userSsoDetails {
      }
    }
  }

In this example, the idToken field is a scalar, so it is included in the code block. In this example the userSsoDetails field is an object, so its fields are not included in the code block.

Link to this function

header(text, level, capitalize \\ false)

View Source
@spec header(String.t(), non_neg_integer(), boolean()) :: String.t()
@spec link(String.t(), String.t() | nil) :: String.t()
Link to this function

list(text, level, capitalize \\ false)

View Source
@spec list(String.t(), non_neg_integer(), boolean()) :: String.t()
@spec new_line() :: String.t()
@spec table(list(), list()) :: String.t()