types

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Overview

Custom implementation of JSON type because graph-gophers/graphql-go does not support the custom JSON scalar type

Custom implementation of JSON type because graph-gophers/graphql-go does not support the custom JSON scalar type

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSON

type JSON struct {
	datatypes.JSON
}

datatype required to be used by gorm so we can support multiple database types for our JSON blobs

func (JSON) ImplementsGraphQLType

func (JSON) ImplementsGraphQLType(name string) bool

func (*JSON) UnmarshalGraphQL

func (j *JSON) UnmarshalGraphQL(input interface{}) error

type Time

type Time struct {
	datatypes.Date
}

Time is a custom GraphQL type to represent an instant in time. It has to be added to a schema via "scalar Time" since it is not a predeclared GraphQL type like "ID".

func (Time) ImplementsGraphQLType

func (Time) ImplementsGraphQLType(name string) bool

ImplementsGraphQLType maps this custom Go type to the graphql scalar type in the schema.

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON is a custom marshaler for Time

This function will be called whenever you query for fields that use the Time type

func (*Time) UnmarshalGraphQL

func (t *Time) UnmarshalGraphQL(input interface{}) error

UnmarshalGraphQL is a custom unmarshaler for Time

This function will be called whenever you use the time scalar as an input

Jump to

Keyboard shortcuts

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