graphql

package
v0.0.0-...-85d8416 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var User = graphql.NewObject(
	graphql.ObjectConfig{
		Name: "User",
		Fields: graphql.Fields{
			"id": &graphql.Field{
				Type: graphql.Int,
			},
			"name": &graphql.Field{
				Type: graphql.String,
			},
			"age": &graphql.Field{
				Type: graphql.Int,
			},
		},
	},
)

User describes a graphql object containing a User

Functions

func ExecuteQuery

func ExecuteQuery(query string, schema graphql.Schema) *graphql.Result

ExecuteQuery runs our graphql queries

Types

type Resolver

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

Resolver struct connect to database

func (*Resolver) UserRes

func (r *Resolver) UserRes(p graphql.ResolveParams) (interface{}, error)

UserRes call GetUser to query users by name

type Root

type Root struct {
	Query *graphql.Object
}

Root struct for querying

func NewRoot

func NewRoot(db *postgres.Db) *Root

NewRoot returns root query type

Jump to

Keyboard shortcuts

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