posts

package
v0.0.0-...-4b43d43 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePostQuery

func CreatePostQuery(db *sql.DB, postType *graphql.Object) *graphql.Field

func CreatePostsQuery

func CreatePostsQuery(db *sql.DB, postType *graphql.Object) *graphql.Field

func CreateType

func CreateType(db *sql.DB, commentType *graphql.Object) *graphql.Object

Types

type Post

type Post struct {
	ID     int    `json:"id"`
	Author string `json:"author"`
	Title  string `json:"title"`
	Body   string `json:"body"`
}

func FetchPostByID

func FetchPostByID(db *sql.DB, id int) (*Post, error)

func FetchPosts

func FetchPosts(db *sql.DB) ([]*Post, error)

Jump to

Keyboard shortcuts

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