Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { SchemaFilename StringList `yaml:"schema,omitempty"` Model config.PackageConfig `yaml:"model,omitempty"` AutoBind []string `yaml:"autobind"` Client config.PackageConfig `yaml:"client,omitempty"` Federation config.PackageConfig `yaml:"federation,omitempty"` Models config.TypeMap `yaml:"models,omitempty"` Endpoint *EndPointConfig `yaml:"endpoint,omitempty"` Generate *GenerateConfig `yaml:"generate,omitempty"` Query []string `yaml:"query"` // gqlgen config struct GQLConfig *config.Config `yaml:"-"` }
Config extends the gqlgen basic config and represents the config file
func LoadConfig ¶
LoadConfig loads and parses the config gqlgenc config
func LoadConfigFromDefaultLocations ¶
LoadConfigFromDefaultLocations looks for a config file in the specified directory, and all parent directories walking up the tree. The closest config file will be returned.
type EndPointConfig ¶
type EndPointConfig struct { URL string `yaml:"url"` Headers map[string]string `yaml:"headers,omitempty"` }
EndPointConfig are the allowed options for the 'endpoint' config
type GenerateConfig ¶
type GenerateConfig struct { Prefix *NamingConfig `yaml:"prefix,omitempty"` Suffix *NamingConfig `yaml:"suffix,omitempty"` UnamedPattern string `yaml:"unamedPattern,omitempty"` // Deprecated: not working because it is generated by gqlgen Query *bool `yaml:"query,omitempty"` // Deprecated: not working because it is generated by gqlgen Mutation *bool `yaml:"mutation,omitempty"` Client *bool `yaml:"client,omitempty"` ClientInterfaceName *string `yaml:"clientInterfaceName,omitempty"` OmitEmptyTypes *bool `yaml:"omitEmptyTypes,omitempty"` EnableClientJsonOmitemptyTag *bool `yaml:"enableClientJsonOmitemptyTag,omitempty"` // Deprecated: not working because v1 is deleted. Must use ClientV2 // if true, used client v2 in generate code ClientV2 bool `yaml:"clientV2,omitempty"` StructFieldsAlwaysPointers *bool `yaml:"structFieldsAlwaysPointers,omitempty"` OnlyUsedModels *bool `yaml:"onlyUsedModels,omitempty"` }
func (*GenerateConfig) GetClientInterfaceName ¶ added in v0.0.5
func (c *GenerateConfig) GetClientInterfaceName() *string
func (*GenerateConfig) IsEnableClientJsonOmitemptyTag ¶ added in v0.28.0
func (c *GenerateConfig) IsEnableClientJsonOmitemptyTag() bool
IsEnableClientJsonOmitemptyTag controls whether the "omitempty" option is added to JSON tags. If EnableClientJsonOmitemptyTag is set to false, even optional fields will not include "omitempty". The default value is true.
func (*GenerateConfig) ShouldGenerateClient ¶
func (c *GenerateConfig) ShouldGenerateClient() bool
func (*GenerateConfig) ShouldOmitEmptyTypes ¶ added in v0.11.3
func (c *GenerateConfig) ShouldOmitEmptyTypes() bool
type NamingConfig ¶
type StringList ¶
type StringList []string
StringList is a simple array of strings
func (StringList) Has ¶
func (a StringList) Has(file string) bool
Has checks if the strings array has a give value