Documentation
¶
Overview ¶
Package schema can be used to generate a GraphQL schema (as a string) from Go structure(s) representing the GraphQL query (and mutation and subscription) entry points. This goes hand-in-hand with the "handler" which uses instantiations of those same structures to fulfill the query (mutation/subscription).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build generates a string containing a GraphQL schema.
- rawEnums: map of enums where each map entry is a slice of strings - each string (incl. map keys) is a name opt. followed by hash (#) and a description. It can be nil if no enums are supplied.
- 2nd, 3rd and 4th parameters represent the root query, mutation and subscription and *must* be structs (or nil). Each struct is scanned for exported fields to be used to generate the query fields. Any of the 3 can be nil if not implemented, but you must supply at least one.
Types ¶
type EntryPoint ¶
type EntryPoint int
EntryPoint is an "enumeration" for the 3 different types of GraphQL entry point (query, mutation, subscription)
const ( Query EntryPoint = iota Mutation Subscription )
Click to show internal directories.
Click to hide internal directories.