Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StructToFields ¶
StructToFields takes a json tag and generate fields.
The following function supports the json tag rules, and adding additional tags:
- type - The datatype to use (Golang's basic data types). If non provided, the default data type of the field will be used.
- desc - description for the field
- deprecation - A deprecation message for the field
Example for struct:
type test struct { ID int `json:"id,omitempty" desc:"foo bar" type:"int64"` Name string `json:"-"` DateTime time.Time `json:"date_time" type:"time" desc:"DateTime"` KeyName int64 `json:"-," deprecation:""` Nothing string }
func TypeToGQLType ¶
TypeToGQLType takes a string with a type and converts it into graphql Scalar. If unknown type is found, it returns graphql.String.
Supported data types:
- integer (byte, uintptr, int, int8, int16, int32, int64, uint..uint64)
- floating point (float32, float64, complex64, complex128)
- string (string, rune)
- date/time
- boolean
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.