resolvers

package
v0.0.0-...-5346628 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeResolver

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

NodeResolver contains the node for resolving

func (*NodeResolver) ID

func (n *NodeResolver) ID() graphql.ID

ID of the node

func (*NodeResolver) ToUser

func (n *NodeResolver) ToUser() (*UserResolver, bool)

ToUser resolves the node to a user

type Query

type Query struct {
	DB *db.Services
}

Query contains the DB so it's made available in all resolvers

func (*Query) AllUsers

func (p *Query) AllUsers(ctx context.Context) ([]*UserResolver, error)

Edges gives a list of all the review edges that belong to a post [TODO] NEEDS MASSIVE CLEANUP AND micro-post Edges should maybe have the same approach

func (*Query) Node

func (q *Query) Node(args struct{ ID string }) (*NodeResolver, error)

Node is the top level node query resolver for relationships between services

func (*Query) User

func (q *Query) User(ctx context.Context, args struct{ ID *string }) (*UserResolver, error)

User resolves the post query

type UserResolver

type UserResolver struct {
	DB *db.Services
	// contains filtered or unexported fields
}

UserResolver contains the DB and the model for resolving

func (*UserResolver) Firstname

func (u *UserResolver) Firstname() string

func (*UserResolver) ID

func (u *UserResolver) ID() graphql.ID

func (*UserResolver) Lastname

func (u *UserResolver) Lastname() string

Jump to

Keyboard shortcuts

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