shopify_draft_proxy/proxy/metaobject_definitions
Stateful Gleam port of the metaobject definition + entry runtime.
This module mirrors the TypeScript metaobject-definitions.ts slice:
definitions and entries are staged locally, downstream reads resolve from
effective base+staged state, and successful supported mutations record log
drafts for commit replay.
Types
pub type MetaobjectDefinitionsError {
ParseFailed(root_field.RootFieldError)
}
Constructors
-
ParseFailed(root_field.RootFieldError)
pub type MutationOutcome {
MutationOutcome(
data: json.Json,
store: store.Store,
identity: synthetic_identity.SyntheticIdentityRegistry,
staged_resource_ids: List(String),
log_drafts: List(mutation_helpers.LogDraft),
)
}
Constructors
-
MutationOutcome( data: json.Json, store: store.Store, identity: synthetic_identity.SyntheticIdentityRegistry, staged_resource_ids: List(String), log_drafts: List(mutation_helpers.LogDraft), )
Values
pub fn handle_metaobject_definitions_query(
store: store.Store,
document: String,
variables: dict.Dict(String, root_field.ResolvedValue),
) -> Result(json.Json, MetaobjectDefinitionsError)
pub fn handle_query_request(
proxy: proxy_state.DraftProxy,
request: proxy_state.Request,
parsed: parse_operation.ParsedOperation,
primary_root_field: String,
document: String,
variables: dict.Dict(String, root_field.ResolvedValue),
) -> #(proxy_state.Response, proxy_state.DraftProxy)
pub fn is_metaobject_definitions_mutation_root(
name: String,
) -> Bool
pub fn is_metaobject_definitions_query_root(name: String) -> Bool
pub fn metaobject_definition_source(
definition: types.MetaobjectDefinitionRecord,
) -> graphql_helpers.SourceValue
pub fn metaobject_source(
store: store.Store,
metaobject: types.MetaobjectRecord,
) -> graphql_helpers.SourceValue
pub fn process(
store: store.Store,
document: String,
variables: dict.Dict(String, root_field.ResolvedValue),
) -> Result(json.Json, MetaobjectDefinitionsError)
pub fn process_mutation(
store: store.Store,
identity: synthetic_identity.SyntheticIdentityRegistry,
request_path: String,
document: String,
variables: dict.Dict(String, root_field.ResolvedValue),
) -> Result(MutationOutcome, MetaobjectDefinitionsError)
pub fn process_mutation_with_upstream(
store: store.Store,
identity: synthetic_identity.SyntheticIdentityRegistry,
request_path: String,
document: String,
variables: dict.Dict(String, root_field.ResolvedValue),
upstream: upstream_query.UpstreamContext,
) -> Result(MutationOutcome, MetaobjectDefinitionsError)