Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateQuery ¶
func ValidateQuery(query string, schema *Schema, config *ValidationConfig) error
ValidateQuery validates a GraphQL query against the provided schema. It checks for unknown fields as well as for possible malicious queries.
Types ¶
type Schema ¶
type Schema struct { Raw string Types map[string]*nodes.Block `json:"types,omitempty"` RootQuery string `json:"root_query,omitempty"` RootMutation string `json:"root_mutation,omitempty"` }
Schema represents a parsed GraphQL schema.
func LoadSchema ¶
LoadSchema loads a GraphQL schema from a directory.
type ValidationConfig ¶
ValidationConfig is used to control which errors are ignored / raised / corrected by the validator.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.