pify/graphql

Decoders and text helpers shared by the query modules.

Types

One page of a connection read through nodes.

pub type Connection(a) {
  Connection(nodes: List(a), page_info: PageInfo)
}

Constructors

  • Connection(nodes: List(a), page_info: PageInfo)
pub type PageInfo {
  PageInfo(
    has_next_page: Bool,
    end_cursor: option.Option(String),
  )
}

Constructors

  • PageInfo(has_next_page: Bool, end_cursor: option.Option(String))

Values

pub fn connection_decoder(
  node_decoder: decode.Decoder(a),
) -> decode.Decoder(Connection(a))

{ nodes { ... } pageInfo { hasNextPage endCursor } }.

pub fn nodes_decoder(
  node_decoder: decode.Decoder(a),
) -> decode.Decoder(List(a))

{ nodes { ... } } without paging.

pub fn optional(
  name: String,
  field_decoder: decode.Decoder(a),
  next: fn(option.Option(a)) -> decode.Decoder(b),
) -> decode.Decoder(b)

A nullable field that may also be absent.

pub fn page_info_decoder() -> decode.Decoder(PageInfo)
pub fn search_any(field: String, values: List(String)) -> String

field:"value" OR field:"value" over every value.

pub fn search_value(text: String) -> String

A value for Shopify search syntax (query: arguments). Double quotes keep spaces and the operators : ( ) inside the value, as in the documented created_at:>'2020-10-21T23:39:20Z'. Only the backslash and the double quote are escaped inside them.

pub fn user_errors_decoder() -> decode.Decoder(
  List(error.UserError),
)

A mutation’s userErrors. field is nullable in the schema.

✨ Search Document