Skip to content

Adds Iterable support to returned values - #679

Merged
bbakerman merged 4 commits into
graphql-java:masterfrom
bbakerman:667-iterable-in-batched-es
Sep 5, 2017
Merged

bbakerman merged 4 commits into
graphql-java:masterfrom
bbakerman:667-iterable-in-batched-es

Conversation

@bbakerman

Copy link
Copy Markdown
Member

See #676

@bbakerman bbakerman added this to the 5.0 milestone Sep 2, 2017

@andimarek andimarek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a test is missing ... I think #676 has one.

throw new BatchAssertionFailed("BatchedDataFetcher provided a null Iterable of result values. Affected fields are set to null.");
}
return values;
long size = iterableResult.spliterator().estimateSize();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not always safe, as estimateSize() can return Long.MAX_VALUE in certain cases. Since values are anyway copied to a new list few lines below this, you could just check that one after copying.

…atched-es

# Conflicts:
#	src/test/groovy/graphql/execution/batched/FunWithStringsSchemaFactory.java
runTest(query, expected)
}

}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test from the other PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants