Skip to content

Validate types implement interfaces #25

Open
@bhavinshah7

Description

@bhavinshah7

Add a schema validation rule ensuring object and interface types have all the fields that they need to implement the interfaces they say they implement.

//Object
ObjectTypeDefinition : desc=StringValue? 'type' name=Name implementsInterfaces=ImplementsInterfaces? directives+=Directive* ('{' fieldDefinition+=FieldDefinition* '}')?;
ObjectTypeExtensionDefinition:'extend' 'type' name=Name implementsInterfaces=ImplementsInterfaces? directives+=Directive* ('{' fieldDefinition+=FieldDefinition* '}')? ;

//Interface
InterfaceTypeDefinition : desc=StringValue? 'interface' name=Name implementsInterfaces=ImplementsInterfaces? directives+=Directive* ('{' fieldDefinition+=FieldDefinition* '}')?;

InterfaceTypeExtensionDefinition: 'extend' 'interface' name=Name implementsInterfaces=ImplementsInterfaces? directives+=Directive* ('{' fieldDefinition+=FieldDefinition* '}')?;

Other validations for reference

Add to an existing validation class or link a new validation here

similar validation in graphql-java

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions