-
Notifications
You must be signed in to change notification settings - Fork 24
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
Adding defer to engine tests #521
Conversation
…ngine-tests # Conflicts: # test/src/test/kotlin/graphql/nadel/tests/EngineTests.kt
# Conflicts: # lib/build.gradle.kts
@@ -39,7 +40,7 @@ class RemoveFieldTestTransform : NadelTransform<GraphQLError> { | |||
?: return null | |||
|
|||
if (objectType.getField(overallField.name)?.getDirective("toBeDeleted") != null) { | |||
return ValidationError(ValidationErrorType.WrongType) | |||
return newValidationError().validationErrorType(ValidationErrorType.WrongType).build() |
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.
Need to use builder here in latest graphql-java as @bbakerman removed the deprecated constructor
.label(it["label"] as String) | ||
.path(it["path"] as List<Object>) | ||
.apply { | ||
if (it["extensions"] != null) extensions(it["extensions"] as Map<Any, Any>) | ||
if (it["errors"] != null) errors(it["errors"] as List<GraphQLError>) | ||
} |
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.
only label and path are required as per spec here:
https://github.com/graphql/graphql-spec/blob/c630301560d9819d33255d3ba00f548e8abbcdc6/spec/Section%207%20--%20Response.md?plain=1#L376C19-L377C53
Are we asserting the new |
the assertion will be in its own PR 👍 |
) | ||
} | ||
else if (serviceCall.incrementalResponse != null) { | ||
fun transformData(executionResult: JsonMap): DelayedIncrementalPartialResult{ |
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 this function needs a more specific name: transformDelayedIncrementalPartialResult
or transformDelayed
...
I'd also move its definition out of the getServiceExecution
function for better readability.
The other transformation steps could also be extracted into their own functions: transformExecutionResult
, transformIncrementalExecutionResult
, etc.
# Conflicts: # test/src/test/kotlin/graphql/nadel/tests/EngineTests.kt # test/src/test/kotlin/graphql/nadel/tests/TestFixture.kt # test/src/test/resources/fixtures/defer/defer-with-label.yml
this PR is to enable us to run engine tests for the
@defer
directive according to thegraphql-spec