helpers

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Login

func Login() error

func RunCommand

func RunCommand(args []string) io.Reader

Types

type GraphQLClient

type GraphQLClient struct {
	Endpoint   string
	HTTPClient *http.Client
	AuthHeader string // Optional: for authentication
}

GraphQLClient is a simple client for making GraphQL requests

func NewGraphQLClient

func NewGraphQLClient(endpoint string) *GraphQLClient

NewGraphQLClient creates a new GraphQL client

func (*GraphQLClient) Execute

func (c *GraphQLClient) Execute(query string, variables map[string]interface{}, result any) error

Execute sends a GraphQL request and returns the response

type GraphQLRequest

type GraphQLRequest struct {
	Query         string                 `json:"query"`
	Variables     map[string]interface{} `json:"variables,omitempty"`
	OperationName string                 `json:"operationName,omitempty"`
}

GraphQLRequest represents the structure of a GraphQL query request

type Result

type Result struct {
	Data struct {
		SignIn struct {
			IDToken string `json:"idToken"`
		} `json:"signIn"`
	} `json:"data"`
	Errors []struct {
		Message string `json:"message"`
	} `json:"errors"`
}

Jump to

Keyboard shortcuts

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