Interface represents a GraphQL Interface type in dagql. Unlike Class (which represents object types), an Interface only declares field *specs* — it has no resolvers of its own. Concrete objects that implement the interface provide the actual field implementations.
| 18 | // field *specs* — it has no resolvers of its own. Concrete objects that |
| 19 | // implement the interface provide the actual field implementations. |
| 20 | type Interface struct { |
| 21 | name string |
| 22 | description string |
| 23 | fields map[string][]*InterfaceFieldSpec |
| 24 | fieldsL *sync.Mutex |
| 25 | |
| 26 | // relationsL protects the schema relationships that can change after an |
| 27 | // interface has been installed. Query parsing reads implementors to decide |
| 28 | // whether fragment type conditions apply, while module schema construction can |
| 29 | // register implementations concurrently for dependency-aware schemas. |
| 30 | relationsL *sync.RWMutex |
| 31 | directives []*ast.Directive |
| 32 | |
| 33 | // implementors tracks which object types implement this interface. |
| 34 | // Keys are type names. |
| 35 | implementors map[string]struct{} |
| 36 | |
| 37 | // interfaces tracks which other interfaces this interface implements. |
| 38 | // Keys are interface names. |
| 39 | interfaces map[string]*Interface |
| 40 | } |
| 41 | |
| 42 | // InterfaceFieldSpec pairs a FieldSpec with optional view gating, |
| 43 | // mirroring how object fields work. |
nothing calls this directly
no outgoing calls
no test coverage detected