examples

package
v0.0.0-...-56a8833 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 3 Imported by: 0

README

Example app

A very simple example to use fiber-graphql-go to build a graphql server

to run this example, do:

go run ./examples/server.go

the server will be listening to port 9000. Below is an example curl command to call the pendingTodo query

curl --request POST \
  --url http://localhost:9000/graphql \
  --header 'Content-Type: application/json' \
  --data '{"query":"{\n  pendingTodo {\n    id,\n    description\n    type\n    isDone\n  }\n}"}'

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadSchemaFile

func ReadSchemaFile() (string, error)

Types

type Resolver

type Resolver struct{}

func (*Resolver) MarkItemDone

func (r *Resolver) MarkItemDone(args struct{ ID graphql.ID }) (*todoItemResolver, error)

func (*Resolver) PendingTodo

func (r *Resolver) PendingTodo() []*todoItemResolver

func (*Resolver) Todo

func (r *Resolver) Todo(args struct{ ID graphql.ID }) (*todoItemResolver, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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