graphql

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphQLClientTransport

type GraphQLClientTransport struct {
	// contains filtered or unexported fields
}

GraphQLClientTransport is a simple, robust, production-ready GraphQL transport using gql. Stateless, per-operation. Supports all GraphQL features.

func NewGraphQLClientTransport

func NewGraphQLClientTransport(logger func(msg string, err error)) *GraphQLClientTransport

NewGraphQLClientTransport creates a new transport instance.

func (*GraphQLClientTransport) CallTool

func (t *GraphQLClientTransport) CallTool(ctx context.Context, toolName string, arguments map[string]any, toolProvider Provider, l *string) (any, error)

CallTool executes a GraphQL operation by name with proper type support.

func (*GraphQLClientTransport) CallToolStream added in v1.5.8

func (t *GraphQLClientTransport) CallToolStream(
	ctx context.Context,
	toolName string,
	args map[string]any,
	p Provider,
) (transports.StreamResult, error)

func (*GraphQLClientTransport) Close

func (t *GraphQLClientTransport) Close() error

Close clears cached tokens.

func (*GraphQLClientTransport) DeregisterToolProvider

func (t *GraphQLClientTransport) DeregisterToolProvider(ctx context.Context, manualProv Provider) error

DeregisterToolProvider is a no-op for stateless transport.

func (*GraphQLClientTransport) RegisterToolProvider

func (t *GraphQLClientTransport) RegisterToolProvider(
	ctx context.Context,
	manualProv Provider,
) ([]Tool, error)

RegisterToolProvider discovers the schema and registers GraphQL fields as tools.

type OAuth2TokenResponse

type OAuth2TokenResponse struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	ExpiresIn   int    `json:"expires_in"`
	Scope       string `json:"scope"`
}

OAuth2TokenResponse holds the response fields from an OAuth2 token endpoint.

type SubscriptionResult

type SubscriptionResult struct {
	// contains filtered or unexported fields
}

SubscriptionResult represents the result of a GraphQL subscription

func (*SubscriptionResult) Close

func (sr *SubscriptionResult) Close() error

Close closes the subscription connection

func (*SubscriptionResult) Next

func (sr *SubscriptionResult) Next() (interface{}, error)

Next returns the next piece of data from the subscription

type TypedArgument

type TypedArgument struct {
	Value interface{}
	Type  string // GraphQL type like "String", "Int", "Boolean", "MyInputType"
}

TypedArgument allows passing type information with arguments

Jump to

Keyboard shortcuts

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