Documentation
¶
Index ¶
- Constants
- Variables
- func CheckAllowedGraphqlQuery(allowedQueries []string, allowedMutations []string, queryString string) error
- func ParseSchema(response ResponseIntrospection, filter Filter) string
- func Query[T any](ctx context.Context, graphqlURL string, query string, variables map[string]any, ...) error
- type EnumValue
- type Errors
- type Extensions
- type Field
- type Filter
- type InputValue
- type IntrospectionResponse
- type Kind
- type Queries
- type Response
- type ResponseIntrospection
- type Schema
- type Type
Constants ¶
View Source
const IntrospectionQuery = `` /* 1274-byte string literal not displayed */
Variables ¶
Functions ¶
func CheckAllowedGraphqlQuery ¶ added in v0.0.4
func ParseSchema ¶
func ParseSchema(response ResponseIntrospection, filter Filter) string
ParseSchema converts an introspection query result into a GraphQL SDL string.
Types ¶
type Errors ¶
type Errors struct {
Message string `json:"message"`
Extensions Extensions `json:"extensions"`
}
type Extensions ¶
type Field ¶
type Field struct {
Name string `json:"name"`
Description *string `json:"description"`
Args []InputValue `json:"args"`
Type Type `json:"type"`
}
Field represents a field in a GraphQL type.
type InputValue ¶
type InputValue struct {
Name string `json:"name"`
Description *string `json:"description"`
Type Type `json:"type"`
DefaultValue *string `json:"defaultValue"`
}
InputValue represents an input value in a GraphQL schema.
type IntrospectionResponse ¶
type IntrospectionResponse struct {
Schema Schema `json:"__schema"`
}
type ResponseIntrospection ¶
type ResponseIntrospection = Response[IntrospectionResponse]
type Schema ¶
type Schema struct {
QueryType Type `json:"queryType"`
MutationType *Type `json:"mutationType"`
Types []Type `json:"types"`
}
Schema represents the GraphQL schema.
type Type ¶
type Type struct {
Kind Kind `json:"kind"`
Name *string `json:"name"`
Description *string `json:"description"`
Fields []Field `json:"fields"`
InputFields []InputValue `json:"inputFields"`
Interfaces []Type `json:"interfaces"`
EnumValues []EnumValue `json:"enumValues"`
PossibleTypes []Type `json:"possibleTypes"`
// For TypeRef fragment
OfType *Type `json:"ofType"`
}
Type represents a GraphQL type (__Type).
Click to show internal directories.
Click to hide internal directories.