Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GraphQLParser ¶
type GraphQLParser struct {
// TargetParam is the paramter name for the GraphQL query ( default: "query")
TargetParam string
// ParseVariables enables parsing the "variables" parameter as JSON
ParseVariables bool
// ParseOperationName enable parsing the <operation_name> parameter
ParseOperationName bool
// Strict validate using the RFC
StrictValidation bool
}
GraphQLParser extracts and validates GraphQL query from URL params
func NewGraphQLParser ¶
func NewGraphQLParser() *GraphQLParser
NewGraphQLParser crates a parser with default setting
func (*GraphQLParser) Name ¶
func (p *GraphQLParser) Name() string
Name returns the parser indentifier
type GraphQLQuery ¶
type GraphQLQuery struct {
// The query document
Query string
// Optional Operation name to support multiple operations in document
OperationName string
// Optional variables JSON object
Variables map[string]any
// Raw tokens for metadata
QueryTokens rfcquery.TokenSlice
VariablesTokens rfcquery.TokenSlice
OperationTokens rfcquery.TokenSlice
}
GraphQLQuery represents a GraphQL request from URL parameters
func ParseGraphQLQuery ¶
func ParseGraphQLQuery(query string) (*GraphQLQuery, error)
Click to show internal directories.
Click to hide internal directories.