(schema *Schema)
| 246 | } |
| 247 | |
| 248 | func validateDirectiveDefinitions(schema *Schema) *gqlerror.Error { |
| 249 | directives := make([]string, 0, len(schema.Directives)) |
| 250 | for directive := range schema.Directives { |
| 251 | directives = append(directives, directive) |
| 252 | } |
| 253 | sort.Strings(directives) |
| 254 | for _, directive := range directives { |
| 255 | err := validateDirective(schema, schema.Directives[directive]) |
| 256 | if err != nil { |
| 257 | return err |
| 258 | } |
| 259 | } |
| 260 | return nil |
| 261 | } |
| 262 | |
| 263 | func validateDirective(schema *Schema, def *DirectiveDefinition) *gqlerror.Error { |
| 264 | if err := validateName(def.Position, def.Name); err != nil { |
no test coverage detected
searching dependent graphs…