-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ISSUE-1566: Relax federated type validation rules #1571
Conversation
@@ -128,7 +129,7 @@ class FederatedKeyDirectiveIT { | |||
assertEquals(expected, exception.message) | |||
} | |||
|
|||
@Test | |||
@Disabled("This is a valid case according to Federation 2 spec") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of disabling this test, this code (and referenced sample project) should be deleted
@@ -70,7 +71,7 @@ class FederatedRequiresDirectiveIT { | |||
assertEquals(expected, exception.message) | |||
} | |||
|
|||
@Test | |||
@Disabled("this is a valid use case according to Federation 2 spec") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of disabling this test, this code (and referenced sample project) should be deleted
errors.addAll(validateDirective("$validatedType.${validatedField.name}", REQUIRES_DIRECTIVE_NAME, validatedField.allAppliedDirectivesByName, fieldMap, extendedType)) | ||
} else { | ||
errors.add("base $validatedType type has fields marked with @requires directive, validatedField=${validatedField.name}") | ||
return validateDirective("$validatedType.${validatedField.name}", REQUIRES_DIRECTIVE_NAME, validatedField.allAppliedDirectivesByName, fieldMap, extendedType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this validation should be applied for both base and extended type -> it doesn't make sense to keep this file anymore, move this validateDirective
call directly to FederatedSchemaValidator
@@ -225,7 +226,7 @@ class FederatedSchemaValidatorTest { | |||
* } | |||
*/ | |||
@Test | |||
fun `validate local GraphQLObjectType with valid key directive and field with invalid external directive`() { | |||
fun `validate local GraphQLObjectType with valid key directive and field with external directive`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets just drop this test
@@ -45,7 +45,7 @@ class ValidateRequiresDirectiveKtTest { | |||
* } | |||
*/ | |||
@Test | |||
fun `Verify non extended types and non requires fields returns an error`() { | |||
fun `Verify non extended types and non requires fields returns no error`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think those tests should be dropped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
retest |
📝 Description
Relax federated type validation rules
@external
directive@requires
directive@requires
directive referring to fields with@external
directive🔗 Related Issues
#1566