Documentation
¶
Index ¶
- Variables
- func ConvertCollectionToGraphQLType(collection models.Collection) (*graphql.Object, error)
- func GenerateGraphQLMutations() (*graphql.Object, error)
- func GenerateGraphQLQueries() (*graphql.Object, error)
- func GetOrCreateGraphQLType(collectionName string) (*graphql.Object, error)
- func GetSchema() graphql.Schema
- func InitializeGraphQLSchema() error
- func ResetTypeRegistry()
- func ResolveRelation(p graphql.ResolveParams, collectionID uint, attr models.Attribute) (any, error)
Constants ¶
This section is empty.
Variables ¶
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 ¶
GenerateGraphQLMutations creates the root GraphQL mutation object for all collections.
func GenerateGraphQLQueries ¶
GenerateGraphQLQueries dynamically creates GraphQL queries for each collection.
func GetOrCreateGraphQLType ¶
GetOrCreateGraphQLType retrieves a type from the cache or creates it by fetching its schema.
func GetSchema ¶
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 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.