graphql

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package graphql generates a GraphQL schema from a resolved model.

docs/design/schema-backends.md has the mapping and the reasons for it. Three things are worth knowing before reading the output. It declares output types only: an input type is a second copy of every type with its own rules, and nothing here needs one yet. A primitive GraphQL has no type for is a custom scalar, declared only when something uses it. And an enum whose variants carry fields is a union of one object type per variant, where a variant with no fields carries a placeholder field, because a GraphQL object needs at least one.

Index

Constants

View Source
const Name = "graphql"

Name is what this backend is called, in a target block and as tdl-gen-graphql on PATH.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct{}

Backend implements plugin.Backend.

func (Backend) Describe

func (Backend) Describe() plugin.Description

func (Backend) Generate

func (Backend) Generate(_ context.Context, req *plugin.Request) (*plugin.Response, error)

Generate returns one .graphql file holding every declaration the model owns.

Jump to

Keyboard shortcuts

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