ExShopifySchema.Generator.Graphql.Introspection.Definition.Directive (ExShopifySchema v2024.10.2)

View Source

Directives provide a way to describe alternate runtime execution and type validation behavior in a GraphQL document.

https://spec.graphql.org/October2021/#DirectiveDefinition

## Example introspection payload

  {
    "name": "deprecated",
    "description": "Marks an element of a GraphQL schema as no longer supported.",
    "locations": [
      "FIELD_DEFINITION",
      "ENUM_VALUE",
      "ARGUMENT_DEFINITION",
      "INPUT_FIELD_DEFINITION"
    ],
    "args": [
      {
        "name": "reason",
        "description": "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https://daringfireball.net/projects/markdown/).",
        "type": {
          "kind": "SCALAR",
          "name": "String",
          "ofType": null
        },
        "defaultValue": "\"No longer supported\"",
        "isDeprecated": false,
        "deprecationReason": null
      }
    ]
  }

Summary

Types

location()

@type location() ::
  :schema
  | :scalar
  | :object
  | :field_definition
  | :argument_definition
  | :interface
  | :union
  | :enum
  | :enum_value
  | :input_object
  | :input_field_definition
  | :query
  | :mutation
  | :subscription
  | :field
  | :fragment_definition
  | :fragment_spread
  | :inline_fragment
  | :variable_definition

t()

@type t() :: %ExShopifySchema.Generator.Graphql.Introspection.Definition.Directive{
  args: [
    ExShopifySchema.Generator.Graphql.Introspection.Definition.InputValue.t()
  ],
  description: String.t() | nil,
  locations: [location()],
  name: String.t(),
  repeatable: boolean()
}

Functions

load_json(json)

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