mapper

package
v0.0.0-...-dcc0d81 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GraphQLString   = "String"
	GraphQLInt      = "Int"
	GraphQLFloat    = "Float"
	GraphQLBoolean  = "Boolean"
	GraphQLDateTime = "DateTime"
	GraphQLUUID     = "UUID"
	GraphQLInt64    = "Int64"
)

Mapping constants per spec 4.1.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name        string
	Type        string
	Description string
	Required    bool
}

Field represents a GraphQL field.

type GraphQLType

type GraphQLType struct {
	Name        string
	Kind        TypeKind
	Fields      []Field
	Description string
	EnumValues  []string
}

GraphQLType represents a generated GraphQL type.

type Mapper

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

Mapper converts OpenAPI schemas to GraphQL types.

func New

func New() *Mapper

New creates a new Mapper instance.

func (*Mapper) MapSchemas

func (m *Mapper) MapSchemas(schemas map[string]*parser.SchemaInfo) (map[string]*GraphQLType, error)

MapSchemas converts all schemas to GraphQL types.

type TypeKind

type TypeKind int

TypeKind distinguishes GraphQL type categories.

const (
	TypeKindObject TypeKind = iota
	TypeKindInput
	TypeKindScalar
	TypeKindEnum
	TypeKindList
)

Jump to

Keyboard shortcuts

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