graphql

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider generates GraphQL schemas (SDL - Schema Definition Language) from applications.

func NewProvider

func NewProvider(specVersion string, endpoint string) *Provider

NewProvider creates a new GraphQL schema provider specVersion should be "2021" (June 2021 Edition) or "2018" (October 2018 Edition) endpoint is typically "/graphql" for introspection.

func (*Provider) ContentType

func (p *Provider) ContentType() string

ContentType returns the content type.

func (*Provider) Endpoint

func (p *Provider) Endpoint() string

Endpoint returns the HTTP endpoint where GraphQL introspection is available.

func (*Provider) Generate

func (p *Provider) Generate(ctx context.Context, app farp.Application) (any, error)

Generate generates a GraphQL schema from the application.

func (*Provider) GenerateDescriptor

func (p *Provider) GenerateDescriptor(ctx context.Context, app farp.Application, locationType farp.LocationType, locationConfig map[string]string) (*farp.SchemaDescriptor, error)

GenerateDescriptor generates a complete SchemaDescriptor for this schema.

func (*Provider) Hash

func (p *Provider) Hash(schema any) (string, error)

Hash calculates SHA256 hash of the schema.

func (*Provider) Serialize

func (p *Provider) Serialize(schema any) ([]byte, error)

Serialize converts schema to JSON bytes.

func (*Provider) SetEndpoint

func (p *Provider) SetEndpoint(endpoint string)

SetEndpoint sets the GraphQL endpoint for introspection.

func (*Provider) SpecVersion

func (p *Provider) SpecVersion() string

SpecVersion returns the GraphQL specification version.

func (*Provider) Type

func (p *Provider) Type() farp.SchemaType

Type returns the schema type.

func (*Provider) UseIntrospection

func (p *Provider) UseIntrospection()

UseIntrospection configures the provider to generate introspection query result.

func (*Provider) UseSDL

func (p *Provider) UseSDL()

UseSDL configures the provider to generate SDL format.

func (*Provider) Validate

func (p *Provider) Validate(schema any) error

Validate validates a GraphQL schema.

Jump to

Keyboard shortcuts

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