MCPcopy Create free account
hub / github.com/dagger/dagger / InstallObject

Method InstallObject

dagql/server.go:535–554  ·  view source on GitHub ↗

InstallObject installs the given Object type into the schema, or returns the previously installed type if it was already present

(class ObjectType, directives ...*ast.Directive)

Source from the content-addressed store, hash-verified

533// InstallObject installs the given Object type into the schema, or returns the
534// previously installed type if it was already present
535func (s *Server) InstallObject(class ObjectType, directives ...*ast.Directive) ObjectType {
536 s.installLock.Lock()
537
538 if class, ok := s.objects[class.TypeName()]; ok {
539 s.installLock.Unlock()
540 return class
541 }
542
543 s.invalidateSchemaCache()
544
545 s.objects[class.TypeName()] = class
546 s.interfacesDirty = true
547 s.installLock.Unlock()
548
549 for _, hook := range s.installHooks {
550 hook.InstallObject(class, directives...)
551 }
552
553 return class
554}
555
556// markInterfacesDirty flags interface inference as stale, so it re-runs on the
557// next read of the type system (see reconcileInterfaceImplsIfDirty). Install

Calls 3

invalidateSchemaCacheMethod · 0.95
TypeNameMethod · 0.65
InstallObjectMethod · 0.65