builder

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: MIT Imports: 4 Imported by: 0

README

graphql_plus_minus_query_builder_go

Documentation

Index

Constants

View Source
const DgraphType = "<dgraph.type>"

DgraphType is a predicate that is specific to the dgraph database

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Alias, Name string
	Filters     []FilterFunction
	Expansion   []Field
}

Field defines the outline for guts of a query

type FilterCombinator

type FilterCombinator int

FilterCombinator defines values that describe the operators to combine filters

const (
	AND FilterCombinator = 1 << iota
	OR
	NOT
)

Defines the Values used for FilterCombinators

type FilterFunction

type FilterFunction struct {
	Type FilterFunctionType
}

FilterFunction provides a definition for the rdf filter functions to be constructed

type FilterFunctionType

type FilterFunctionType int

FilterFunctionType defines values that describe the different filters

const (
	UID FilterFunctionType = 1 << iota
	UIDIn
	Has
	EQ
	LT
	GT
	LE
	GE
	AllOfTerms
	AnyOfTerms
	Match
	AllOfText
	AnyOfText
)

Defines the values used for FilterFunctionType

type MutationBuilder

type MutationBuilder struct {
	// contains filtered or unexported fields
}

MutationBuilder is a struct used for building mutation queries

func NewMutationBuilder

func NewMutationBuilder() *MutationBuilder

NewMutationBuilder returns a new graphql+- mutation query builder

func (*MutationBuilder) AddTerm

func (b *MutationBuilder) AddTerm(subject, predicate, value string) *MutationBuilder

AddTerm ads an RDF triple to the Proposed Query

func (*MutationBuilder) Build

func (b *MutationBuilder) Build() string

Build returns the constructed RDF, graphql +- query

type QueryBuilder

type QueryBuilder struct {
	Fields       []Field
	RootFilter   string
	RootFunction string
	// contains filtered or unexported fields
}

QueryBuilder represents a struct that will allow the user to quickly build queries

func NewQueryBuilder

func NewQueryBuilder() *QueryBuilder

NewQueryBuilder returns an object to construct your graphql+- queries

type QueryType

type QueryType int

QueryType defines the type of graphQL+- query

const (
	Query QueryType = 1 << iota
	Set
	Delete
	Upsert
	Schema
)

Query defines the types of query

Jump to

Keyboard shortcuts

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