graph

package
v0.1.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Code generated by mcpgen. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var CondensedSchema = "" /* 1368-byte string literal not displayed */
View Source
var MCPTools = []mcpserver.ToolDefinition{
	{
		Name:        "fetch_get_latest_index",
		Description: "Get the latest CloudEvent index entry (header + storage key) for a DID-scoped subject, optionally filtered by event type, source, producer, or time range. Returns metadata only — use fetch_get_latest_cloud_event for the full payload.",
		Args: []mcpserver.ArgDefinition{
			{Name: "did", Type: "string", Description: "did (String!, required)", Required: true, ItemsType: ""},
			{Name: "filter", Type: "object", Description: "filter (CloudEventFilter, optional)", Required: false, ItemsType: ""},
		},
		Query: "query($did: String!, $filter: CloudEventFilter) { latestIndex(did: $did, filter: $filter) { header { type source subject id time producer dataversion } indexKey } }",
		Annotations: &mcp.ToolAnnotations{
			ReadOnlyHint:    true,
			DestructiveHint: boolPtr(false),
			OpenWorldHint:   boolPtr(false),
			IdempotentHint:  true,
		},
	},
	{
		Name:        "fetch_list_indexes",
		Description: "List CloudEvent index entries for a DID-scoped subject, optionally filtered and limited (default 10). Returns headers + storage keys without payloads — cheaper than fetch_list_cloud_events when exploring.",
		Args: []mcpserver.ArgDefinition{
			{Name: "did", Type: "string", Description: "did (String!, required)", Required: true, ItemsType: ""},
			{Name: "limit", Type: "integer", Description: "limit (Int, optional)", Required: false, ItemsType: ""},
			{Name: "filter", Type: "object", Description: "filter (CloudEventFilter, optional)", Required: false, ItemsType: ""},
		},
		Query: "query($did: String!, $limit: Int, $filter: CloudEventFilter) { indexes(did: $did, limit: $limit, filter: $filter) { header { type source subject id time producer } indexKey } }",
		Annotations: &mcp.ToolAnnotations{
			ReadOnlyHint:    true,
			DestructiveHint: boolPtr(false),
			OpenWorldHint:   boolPtr(false),
			IdempotentHint:  true,
		},
	},
	{
		Name:        "fetch_get_latest_cloud_event",
		Description: "Get the latest full CloudEvent (header + JSON payload) for a DID-scoped subject, optionally filtered. Returns dataUrl (presigned S3 link) for large binary payloads instead of inlining them.",
		Args: []mcpserver.ArgDefinition{
			{Name: "did", Type: "string", Description: "did (String!, required)", Required: true, ItemsType: ""},
			{Name: "filter", Type: "object", Description: "filter (CloudEventFilter, optional)", Required: false, ItemsType: ""},
		},
		Query: "query($did: String!, $filter: CloudEventFilter) { latestCloudEvent(did: $did, filter: $filter) { header { type source subject id time producer } data dataUrl } }",
		Annotations: &mcp.ToolAnnotations{
			ReadOnlyHint:    true,
			DestructiveHint: boolPtr(false),
			OpenWorldHint:   boolPtr(false),
			IdempotentHint:  true,
		},
	},
	{
		Name:        "fetch_list_cloud_events",
		Description: "List full CloudEvents (headers + JSON payloads) for a DID-scoped subject, optionally filtered and limited (default 10). Large binary payloads are returned as presigned S3 URLs via dataUrl instead of inlined data.",
		Args: []mcpserver.ArgDefinition{
			{Name: "did", Type: "string", Description: "did (String!, required)", Required: true, ItemsType: ""},
			{Name: "limit", Type: "integer", Description: "limit (Int, optional)", Required: false, ItemsType: ""},
			{Name: "filter", Type: "object", Description: "filter (CloudEventFilter, optional)", Required: false, ItemsType: ""},
		},
		Query: "query($did: String!, $limit: Int, $filter: CloudEventFilter) { cloudEvents(did: $did, limit: $limit, filter: $filter) { header { type source subject id time producer } data dataUrl } }",
		Annotations: &mcp.ToolAnnotations{
			ReadOnlyHint:    true,
			DestructiveHint: boolPtr(false),
			OpenWorldHint:   boolPtr(false),
			IdempotentHint:  true,
		},
	},
	{
		Name:        "fetch_list_available_event_types",
		Description: "Summarize the CloudEvent types present for a DID-scoped subject. Returns each type with its count, firstSeen, and lastSeen timestamps — useful for discovering what kinds of events exist before querying them.",
		Args: []mcpserver.ArgDefinition{
			{Name: "did", Type: "string", Description: "did (String!, required)", Required: true, ItemsType: ""},
			{Name: "filter", Type: "object", Description: "filter (CloudEventFilter, optional)", Required: false, ItemsType: ""},
		},
		Query: "query($did: String!, $filter: CloudEventFilter) { availableCloudEventTypes(did: $did, filter: $filter) { type count firstSeen lastSeen } }",
		Annotations: &mcp.ToolAnnotations{
			ReadOnlyHint:    true,
			DestructiveHint: boolPtr(false),
			OpenWorldHint:   boolPtr(false),
			IdempotentHint:  true,
		},
	},
}

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type ClaimsContextKey

type ClaimsContextKey struct{}

ClaimsContextKey is the context key for token claims (set by JWT middleware).

type CloudEventResolver

type CloudEventResolver interface {
	Header(ctx context.Context, obj *CloudEventWrapper) (*cloudevent.CloudEventHeader, error)
	Data(ctx context.Context, obj *CloudEventWrapper) (RawJSON, error)
	DataBase64(ctx context.Context, obj *CloudEventWrapper) (*string, error)
}

type CloudEventWrapper

type CloudEventWrapper struct {
	Raw     *cloudevent.RawEvent
	DataURL string // non-empty when the payload is a blob served via presigned URL
}

CloudEventWrapper holds a pointer to a RawEvent so resolvers can expose header, data, dataBase64, and dataUrl without copying the underlying event.

type ComplexityRoot

type ComplexityRoot struct {
	CloudEvent struct {
		Data       func(childComplexity int) int
		DataBase64 func(childComplexity int) int
		DataURL    func(childComplexity int) int
		Header     func(childComplexity int) int
	}

	CloudEventHeader struct {
		DataContentType func(childComplexity int) int
		DataSchema      func(childComplexity int) int
		DataVersion     func(childComplexity int) int
		ID              func(childComplexity int) int
		Producer        func(childComplexity int) int
		RawEventID      func(childComplexity int) int
		Signature       func(childComplexity int) int
		Source          func(childComplexity int) int
		SpecVersion     func(childComplexity int) int
		Subject         func(childComplexity int) int
		Tags            func(childComplexity int) int
		Time            func(childComplexity int) int
		Type            func(childComplexity int) int
	}

	CloudEventIndex struct {
		Header   func(childComplexity int) int
		IndexKey func(childComplexity int) int
	}

	CloudEventTypeSummary struct {
		Count     func(childComplexity int) int
		FirstSeen func(childComplexity int) int
		LastSeen  func(childComplexity int) int
		Type      func(childComplexity int) int
	}

	Query struct {
		AvailableCloudEventTypes func(childComplexity int, did string, filter *model.CloudEventFilter) int
		CloudEvents              func(childComplexity int, did string, limit *int, filter *model.CloudEventFilter) int
		Indexes                  func(childComplexity int, did string, limit *int, filter *model.CloudEventFilter) int
		LatestCloudEvent         func(childComplexity int, did string, filter *model.CloudEventFilter) int
		LatestIndex              func(childComplexity int, did string, filter *model.CloudEventFilter) int
	}
}

type DirectiveRoot

type DirectiveRoot struct {
	McpHide func(ctx context.Context, obj any, next graphql.Resolver) (res any, err error)
}

type QueryResolver

type QueryResolver interface {
	LatestIndex(ctx context.Context, did string, filter *model.CloudEventFilter) (*model.CloudEventIndex, error)
	Indexes(ctx context.Context, did string, limit *int, filter *model.CloudEventFilter) ([]*model.CloudEventIndex, error)
	LatestCloudEvent(ctx context.Context, did string, filter *model.CloudEventFilter) (*CloudEventWrapper, error)
	CloudEvents(ctx context.Context, did string, limit *int, filter *model.CloudEventFilter) ([]*CloudEventWrapper, error)
	AvailableCloudEventTypes(ctx context.Context, did string, filter *model.CloudEventFilter) ([]*model.CloudEventTypeSummary, error)
}

type RawJSON

type RawJSON []byte

RawJSON is the raw bytes of a JSON value. It implements graphql.Marshaler by writing the bytes directly so the payload appears as unescaped JSON (object/array) in the GraphQL response instead of an escaped string.

func (RawJSON) MarshalGQL

func (r RawJSON) MarshalGQL(w io.Writer)

MarshalGQL writes the raw JSON bytes to w so the response contains unescaped JSON.

func (*RawJSON) UnmarshalGQL

func (r *RawJSON) UnmarshalGQL(v interface{}) error

UnmarshalGQL satisfies the graphql.Unmarshaler interface (e.g. for variables). Scalar is primarily used for output (CloudEvent.data); input is not used.

type Resolver

type Resolver struct {
	EventService   *eventrepo.Service
	Buckets        []string
	IdentityClient identity.Client
}

func (*Resolver) CloudEvent

func (r *Resolver) CloudEvent() CloudEventResolver

CloudEvent returns CloudEventResolver implementation.

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

Query returns QueryResolver implementation.

type ResolverRoot

type ResolverRoot interface {
	CloudEvent() CloudEventResolver
	Query() QueryResolver
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL