@@ -170,7 +170,7 @@ func (o *OperationDefinition) GetFieldByName(name []byte) *FieldDefinition {
170170}
171171
172172type DefinitionType interface {
173- * TypeDefinition | * OperationDefinition | * EnumDefinition | * UnionDefinition | * InterfaceDefinition | * InputDefinition | * ScalarDefinition
173+ * TypeDefinition | * OperationDefinition | * EnumDefinition | * UnionDefinition | * InterfaceDefinition | * InputDefinition | * ScalarDefinition | * DirectiveDefinition
174174}
175175
176176type Indexes struct {
@@ -181,6 +181,7 @@ type Indexes struct {
181181 InputIndex map [string ]* InputDefinition
182182 OperationIndexes map [OperationType ]map [string ]* OperationDefinition
183183 ScalarIndex map [string ]* ScalarDefinition
184+ DirectiveIndex map [string ]* DirectiveDefinition
184185}
185186
186187func (i * Indexes ) GetTypeDefinition (name string ) * TypeDefinition {
@@ -675,6 +676,10 @@ func get[T DefinitionType](indexes *Indexes, key string, t T) T {
675676 return any (indexes .InterfaceIndex [key ]).(T )
676677 case * InputDefinition :
677678 return any (indexes .InputIndex [key ]).(T )
679+ case * ScalarDefinition :
680+ return any (indexes .ScalarIndex [key ]).(T )
681+ case * DirectiveDefinition :
682+ return any (indexes .DirectiveIndex [key ]).(T )
678683 }
679684
680685 return nil
@@ -683,6 +688,7 @@ func get[T DefinitionType](indexes *Indexes, key string, t T) T {
683688type ScalarDefinition struct {
684689 Name []byte
685690 Directives []* Directive
691+ Extentions []* ScalarDefinition
686692}
687693
688694type SchemaDefinition struct {
0 commit comments