graphqldoc

package module
v0.0.0-...-559ceaf Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 12 Imported by: 0

README

Documentation generator for GraphQL

Markdown generator for documenting GraphQL schema

Download binary in Releases

Use

Generate dir doc/ with markdown files

$ graphqldoc -h
Usage of graphqldoc:
  -endpoint string
    	Endpoint server graphql. Example https://dominio.com/graphql
  -output-dir string
    	Directory with documentation files (default "doc/")
  -without-ext
    	Does not add extension to markdown file links (.md)
$ graphqldoc -endpoint=http://localhost:8080/graphql

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(endpoint, outputDir string, withoutExt bool)

Generate generate the files with the graphql documentation

Types

type Data

type Data struct {
	Schema Schema `json:"__schema"`
}

Data schema graphql

type Enum

type Enum struct {
	Name        string
	Description string
	Enums       []EnumValues
}

Enum structure for enum data

type EnumValues

type EnumValues struct {
	Name              string `json:"name"`
	Description       string `json:"description"`
	IsDeprecated      bool   `json:"isDeprecated"`
	DeprecationReason string `json:"deprecationReason"`
}

EnumValues type in the schema.graphql

type Field

type Field struct {
	Name              string       `json:"name"`
	Description       string       `json:"description"`
	Args              []InputValue `json:"args"`
	Type              *TypeRef     `json:"type"`
	IsDeprecated      bool         `json:"isDeprecated"`
	DeprecationReason string       `json:"deprecationReason"`
}

Field type in the schema.graphql

type FullType

type FullType struct {
	Kind          string       `json:"kind"`
	Name          string       `json:"name"`
	Description   string       `json:"description"`
	Fields        []Field      `json:"fields"`
	InputFields   []InputValue `json:"inputFields"`
	Interfaces    []TypeRef    `json:"interfaces"`
	EnumValues    []EnumValues `json:"enumValues"`
	PossibleTypes []TypeRef    `json:"possibleTypes"`
}

FullType type in the schema.graphql

type Input

type Input struct {
	Name        string
	Description string
	InputFields []InputValue
}

Input structure for input data

type InputValue

type InputValue struct {
	Name         string      `json:"name"`
	Description  string      `json:"description"`
	DefaultValue interface{} `json:"defaultValue"`
	Type         *TypeRef    `json:"type"`
}

InputValue type in the schema.graphql

type Mutation

type Mutation struct {
	Name              string
	Description       string
	Args              []InputValue
	IsDeprecated      bool
	DeprecationReason string
	Type              *TypeRef
}

Mutation structure for mutation data

type Object

type Object struct {
	Name        string
	Description string
	Fields      []Field
}

Object structure for object data

type Query

type Query struct {
	Name              string
	Description       string
	Args              []InputValue
	IsDeprecated      bool
	DeprecationReason string
	Type              *TypeRef
}

Query structure for query data

type Response

type Response struct {
	Data   Data                     `json:"data"`
	Errors []map[string]interface{} `json:"errors"`
}

Response response server graphql

type Scalar

type Scalar struct {
	Name        string
	Description string
}

Scalar structure for scalar data

type Schema

type Schema struct {
	QueryType        FullType        `json:"queryType"`
	MutationType     FullType        `json:"mutationType"`
	SubscriptionType FullType        `json:"subscriptionType"`
	Types            []FullType      `json:"types"`
	Directives       []TypeDirective `json:"directives"`
}

Schema type in the schema.graphql

type TypeDirective

type TypeDirective struct {
	Name        string       `json:"name"`
	Description string       `json:"description"`
	Args        []InputValue `json:"args"`
	OnOperation bool         `json:"onOperation"`
	OnFragment  bool         `json:"onFragment"`
	OnField     bool         `json:"onField"`
}

TypeDirective type in the schema.graphql

type TypeRef

type TypeRef struct {
	Kind   string   `json:"kind"`
	Name   string   `json:"name"`
	OfType *TypeRef `json:"ofType"`
}

TypeRef type in the schema.graphql

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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