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. The 1st parameter (rawEnums) is a map of enums where each map entry is a slice of
strings - each string is an enum value opt. followed by hash (#) and a description. It can be nil if no enums are needed.
The 2nd, 3rd and 4th parameters represent the root query, mutation and subscription.
Each struct is scanned for public fields (scalars, nested structs, etc) to be used as queries. They can be nil if not implemented.
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.