generator

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: Unlicense Imports: 10 Imported by: 0

Documentation

Overview

Where all the magic happens

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructObjectFromPArgs

func ConstructObjectFromPArgs(modelType reflect.Type, p *graphql.ResolveParams) *interface{}

Reads out the GraphQL arguments and writes them into a new object. Consider this as a kind of deserialization.

func FieldConfigArgs

func FieldConfigArgs(model interface{}) *graphql.FieldConfigArgument

func GenerateGraphQLSchema

func GenerateGraphQLSchema(db *database.Database, models ...interface{}) (graphql.Schema, error)

func GetGraphQLObjType

func GetGraphQLObjType(model interface{}) *graphql.Object

Generates a GraphQL object based on a model. Uses a cache to speed up subsequent calls and make sure there are no duplicates. The cache is very important because otherwise GraphQL will spit out weird errors as it expects every type to only exist once and gets easily confused.

func InputFieldConfigArgs added in v0.4.0

func InputFieldConfigArgs(model interface{}) *graphql.FieldConfigArgument

Types

This section is empty.

Jump to

Keyboard shortcuts

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