diff --git a/schema/enum.go b/schema/enum.go index 4783ccff6fc6..b52b01e1a522 100644 --- a/schema/enum.go +++ b/schema/enum.go @@ -41,7 +41,8 @@ func (e EnumType) TypeName() string { return e.Name } -func (EnumType) isType() {} +func (EnumType) isType() {} +func (EnumType) isReferenceType() {} // Validate validates the enum definition. func (e EnumType) Validate(TypeSet) error { diff --git a/schema/type.go b/schema/type.go index 9728675cd836..a1205ad722a5 100644 --- a/schema/type.go +++ b/schema/type.go @@ -13,6 +13,15 @@ type Type interface { isType() } +// ReferenceType is a marker interface that all types that can be the target of Field.ReferencedType implement. +// Currently, this is only EnumType. +type ReferenceType interface { + Type + + // IsReferenceType is implemented if this is a reference type. + isReferenceType() +} + // TypeSet represents something that has types and allows them to be looked up by name. // Currently, the only implementation is ModuleSchema. type TypeSet interface {