feat(schema): add ReferenceType interface (#21692)
Co-authored-by: cool-developer <51834436+cool-develope@users.noreply.github.com>
This commit is contained in:
parent
01473479c7
commit
397ff0bd22
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user