graphql

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Schema graphql.Schema
)

Schema holds the generated GraphQL schema. It is protected by a RWMutex to allow for safe concurrent access and hot-reloading.

Functions

func ConvertCollectionToGraphQLType

func ConvertCollectionToGraphQLType(collection models.Collection) (*graphql.Object, error)

func GenerateGraphQLMutations

func GenerateGraphQLMutations() (*graphql.Object, error)

GenerateGraphQLMutations creates the root GraphQL mutation object for all collections.

func GenerateGraphQLQueries

func GenerateGraphQLQueries() (*graphql.Object, error)

GenerateGraphQLQueries dynamically creates GraphQL queries for each collection.

func GetOrCreateGraphQLType

func GetOrCreateGraphQLType(collectionName string) (*graphql.Object, error)

GetOrCreateGraphQLType retrieves a type from the cache or creates it by fetching its schema.

func GetSchema

func GetSchema() graphql.Schema

GetSchema safely returns the current GraphQL schema using a read lock. All GraphQL handlers should use this function to get the schema.

func InitializeGraphQLSchema

func InitializeGraphQLSchema() error

InitializeGraphQLSchema dynamically generates the GraphQL schema and protects it with a write lock. This function can be called again at runtime to "hot-reload" the schema if collections change.

func ResetTypeRegistry

func ResetTypeRegistry()

ResetTypeRegistry drops all cached collection and component types.

func ResolveRelation

func ResolveRelation(p graphql.ResolveParams, collectionID uint, attr models.Attribute) (any, error)

ResolveRelation handles fetching related items in a GraphQL query.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL