graph-quilt / graphql-xtext

A GraphQL SDL lexer, parser, and validator that can read GraphQL grammar and produce executable JVM runtime objects.
Other
22 stars 6 forks source link

Validate types implement interfaces #25

Open bhavinshah7 opened 1 year ago

bhavinshah7 commented 1 year ago

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

KshitijSharma745 commented 1 year ago

Hey @bhavinshah7, I would like to work on this. Can you please assign this to me?