graphql

package
v0.1.1-beta.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DMScalarType = graphql.NewScalar(graphql.ScalarConfig{
	Name:        "DMScalarType",
	Description: "Digimaker scalar type.",
	Serialize: func(value interface{}) interface{} {
		switch value := value.(type) {
		case fieldtypes.Json:

			return value
		default:
			return value
		}
	},
	ParseValue: func(value interface{}) interface{} {
		switch value := value.(type) {
		case string:
			j := fieldtypes.Json{}
			j.Content = []byte(value)
			return j
		default:
			return nil
		}
	},
	ParseLiteral: func(valueAST ast.Value) interface{} {
		switch valueAST := valueAST.(type) {
		case *ast.StringValue:
			return fieldtypes.Json{Content: []byte(valueAST.Value)}
		default:
			return nil
		}
	},
})

Digimaker scalar type

Functions

func AuthAPIKey

func AuthAPIKey(r *http.Request) error

set graphql/api_key in dm.yaml

func Load

func Load()

Types

type ArrModel

type ArrModel struct {
	ArrInt    []int
	ArrString []string
}

Jump to

Keyboard shortcuts

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