fix(schema)!: fixes and key restrictions based on indexer testing (#21362)

This commit is contained in:
Aaron Craelius
2024-08-20 22:52:49 +00:00
committed by GitHub
parent 08a3da44b1
commit 95dcf845c3
14 changed files with 444 additions and 295 deletions
+3 -3
View File
@@ -29,7 +29,7 @@ var objectTypesGen = rapid.Custom(func(t *rapid.T) []schema.ObjectType {
}).Filter(func(objectTypes []schema.ObjectType) bool {
typeNames := map[string]bool{}
for _, objectType := range objectTypes {
if hasDuplicateNames(typeNames, objectType.KeyFields) || hasDuplicateNames(typeNames, objectType.ValueFields) {
if hasDuplicateTypeNames(typeNames, objectType.KeyFields) || hasDuplicateTypeNames(typeNames, objectType.ValueFields) {
return false
}
if typeNames[objectType.Name] {
@@ -43,9 +43,9 @@ var objectTypesGen = rapid.Custom(func(t *rapid.T) []schema.ObjectType {
// MustNewModuleSchema calls NewModuleSchema and panics if there's an error. This should generally be used
// only in tests or initialization code.
func MustNewModuleSchema(objectTypes []schema.ObjectType) schema.ModuleSchema {
schema, err := schema.NewModuleSchema(objectTypes)
sch, err := schema.NewModuleSchema(objectTypes)
if err != nil {
panic(err)
}
return schema
return sch
}