gql

package
v0.0.0-...-9004257 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Varchar = graphql.NewScalar(graphql.ScalarConfig{
	Name: "Varchar",
	Description: "The `Varchar` scalar type represents textual data, represented as UTF-8 " +
		"character sequences. The String type is most often used by GraphQL to " +
		"represent free-form human-readable text.",
	Serialize: func(value interface{}) interface{} {
		switch value := value.(type) {
		case pgtype.Varchar:
			return value.Get()
		default:
			return nil
		}
	},
	ParseValue: func(value interface{}) interface{} {
		switch value := value.(type) {
		case string:
			var v pgtype.Varchar
			v.Set(value)
			return v
		case *string:
			var v pgtype.Varchar
			v.Set(*value)
			return v
		default:
			return nil
		}
	},
	ParseLiteral: func(valueAST ast.Value) interface{} {
		switch valueAST := valueAST.(type) {
		case *ast.StringValue:
			var v pgtype.Varchar
			v.Set(valueAST.Value)
			return v
		}
		return nil
	},
})

Varchar pgtype string for graphql

Functions

func AddSinkMutationField

func AddSinkMutationField() *graphql.Field

AddSinkMutationField for adding a new sink

func DelSinkMutationField

func DelSinkMutationField() *graphql.Field

DelSinkMutationField returns the field to delete a sink

func GetSinksQueryField

func GetSinksQueryField() *graphql.Field

GetSinksQueryField for querying multiple users

Types

This section is empty.

Jump to

Keyboard shortcuts

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