InstallInterface installs the given Interface type into the schema. If an interface with the same name is already installed, it is returned.
(iface *Interface, directives ...*ast.Directive)
| 570 | // InstallInterface installs the given Interface type into the schema. |
| 571 | // If an interface with the same name is already installed, it is returned. |
| 572 | func (s *Server) InstallInterface(iface *Interface, directives ...*ast.Directive) *Interface { |
| 573 | s.installLock.Lock() |
| 574 | if len(directives) > 0 { |
| 575 | iface.addDirectives(directives...) |
| 576 | } |
| 577 | installed := s.installInterfaceLocked(iface) |
| 578 | s.installLock.Unlock() |
| 579 | |
| 580 | for _, hook := range s.installHooks { |
| 581 | hook.InstallInterface(installed, directives...) |
| 582 | } |
| 583 | |
| 584 | return installed |
| 585 | } |
| 586 | |
| 587 | // installInterfaceLocked is the lock-held implementation of InstallInterface. |
| 588 | func (s *Server) installInterfaceLocked(iface *Interface) *Interface { |
nothing calls this directly
no test coverage detected