@@ -75,7 +75,7 @@ func (b *iteratorBuilder) buildIteratorFromSchemaInternal(definitionName string,
7575 // Track the position in the sentinels list before building
7676 sentinelsLenBefore := len (b .recursiveSentinels )
7777
78- def , ok := b .schema .Definitions ()[ definitionName ]
78+ def , ok := b .schema .GetTypeDefinition ( definitionName )
7979 if ! ok {
8080 // Remove before returning error
8181 delete (b .building , id )
@@ -84,9 +84,9 @@ func (b *iteratorBuilder) buildIteratorFromSchemaInternal(definitionName string,
8484
8585 var result Iterator
8686 var err error
87- if p , ok := def .Permissions ()[ relationName ] ; ok {
87+ if p , ok := def .GetPermission ( relationName ) ; ok {
8888 result , err = b .buildIteratorFromPermission (p )
89- } else if r , ok := def .Relations ()[ relationName ] ; ok {
89+ } else if r , ok := def .GetRelation ( relationName ) ; ok {
9090 result , err = b .buildIteratorFromRelation (r , withSubRelations )
9191 } else {
9292 err = fmt .Errorf ("BuildIteratorFromSchema: couldn't find a relation or permission named `%s` in definition `%s`" , relationName , definitionName )
@@ -160,7 +160,7 @@ func (b *iteratorBuilder) buildIteratorFromPermission(p *schema.Permission) (Ite
160160func (b * iteratorBuilder ) buildIteratorFromOperation (p * schema.Permission , op schema.Operation ) (Iterator , error ) {
161161 switch perm := op .(type ) {
162162 case * schema.ArrowReference :
163- rel , ok := p .Parent ().Relations ()[ perm .Left ()]
163+ rel , ok := p .Parent ().GetRelation ( perm .Left ())
164164 if ! ok {
165165 return nil , fmt .Errorf ("BuildIteratorFromSchema: couldn't find left-hand relation for arrow `%s->%s` for permission `%s` in definition `%s`" , perm .Left (), perm .Right (), p .Name (), p .Parent ().Name ())
166166 }
@@ -208,7 +208,7 @@ func (b *iteratorBuilder) buildIteratorFromOperation(p *schema.Permission, op sc
208208 return NewExclusion (mainIt , excludedIt ), nil
209209
210210 case * schema.FunctionedArrowReference :
211- rel , ok := p .Parent ().Relations ()[ perm .Left ()]
211+ rel , ok := p .Parent ().GetRelation ( perm .Left ())
212212 if ! ok {
213213 return nil , fmt .Errorf ("BuildIteratorFromSchema: couldn't find arrow relation `%s` for functioned arrow `%s.%s(%s)` for permission `%s` in definition `%s`" , perm .Left (), perm .Left (), functionTypeString (perm .Function ()), perm .Right (), p .Name (), p .Parent ().Name ())
214214 }
0 commit comments