Documentation
¶
Index ¶
- Constants
- func BuildClientSchema(introspection IntrospectionQuery) (graphql.Schema, error)
- func GeneratePackage(schema *graphql.Schema, definitions *ClientDefinitions, packageName string, ...) ([]byte, error)
- type ClientDefinitions
- type FieldType
- type FullTypeFragment
- type InputValueFragment
- type IntrospectionQuery
- type TypeKind
- type TypeRefFragment
Constants ¶
View Source
const GeneratedCommentMarker = "// Code generated by https://github.com/crombird/minigen. DO NOT EDIT."
View Source
const IntrospectionQueryString = `` /* 1116-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func BuildClientSchema ¶
func BuildClientSchema(introspection IntrospectionQuery) (graphql.Schema, error)
func GeneratePackage ¶
func GeneratePackage( schema *graphql.Schema, definitions *ClientDefinitions, packageName string, scalarMap map[string]string, scalarRefHelpers bool, nullableInputTypes bool, ) ([]byte, error)
Generate a golang file based on a remote schema and a bunch of named operations and fragments.
Types ¶
type ClientDefinitions ¶
type ClientDefinitions struct {
Operations map[string]*graphqlAst.OperationDefinition
Fragments map[string]*graphqlAst.FragmentDefinition
}
func ExtractFromPackage ¶
func ExtractFromPackage(directory string) (ClientDefinitions, error)
type FieldType ¶
type FieldType struct {
Name string
Description string
Args []InputValueFragment
Type *TypeRefFragment
IsDeprecated bool
DeprecationReason string
}
type FullTypeFragment ¶
type FullTypeFragment struct {
Kind TypeKind
Name string
Description string
Fields []FieldType
InputFields []InputValueFragment
Interfaces []TypeRefFragment
EnumValues []struct {
Name string
Description string
IsDeprecated bool
DeprecationReason string
}
PossibleTypes []TypeRefFragment
}
type InputValueFragment ¶
type InputValueFragment struct {
Name string
Description string
Type TypeRefFragment
DefaultValue string
}
type IntrospectionQuery ¶
type IntrospectionQuery struct {
Schema struct {
QueryType *struct{ Name string }
MutationType *struct{ Name string }
SubscriptionType *struct{ Name string }
Types []FullTypeFragment
} `json:"__schema"`
}
type TypeRefFragment ¶
type TypeRefFragment struct {
Kind TypeKind
Name string
OfType *TypeRefFragment
}
Click to show internal directories.
Click to hide internal directories.