ExShopifySchema.Generator.Graphql.Introspection.Definition (ExShopifySchema v2024.4.2)

View Source

This module defines the structure of the GraphQL introspection data.

Build introspection from json data

iex> json = file_path |> File.read!() |> Jason.decode!()
iex> ExShopifySchema.Graphql.Introspection.Definition.build(json)
#=> %ExShopifySchema.Graphql.Introspection.Definition{}

Define a new definition schema

defmodule ExShopifySchema.Generator.Graphql.Introspection.Definition.MyDefinition do
  use ExShopifySchema.Generator.Graphql.Introspection.Definition

  schema do
    field :my_field, String.t()
    deprecatable_fields()
  end
end

Summary

Types

t()

The fundamental unit of any GraphQL Schema is the type.

Functions

Builds a GraphQL introspection definition from the introspection JSON data.

Defines the fields that are common to all GraphQL types that can be deprecated.

Types

Functions

build(json)

@spec build(json :: map()) :: t()

Builds a GraphQL introspection definition from the introspection JSON data.

deprecatable_fields()

(macro)

Defines the fields that are common to all GraphQL types that can be deprecated.

This macro is used to define the is_deprecated and deprecation_reason fields conveniently.

schema(list)

(macro)