Skip to content
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

Fix alias in GraphQL subscriptions #857

Merged

Conversation

guidorota
Copy link
Contributor

This commit fixes alias support in GraphQL subscriptions.

See #856.

This commit fixes alias support in GraphQL subscriptions.

See graphql-java#856.
return new ExecutionResultImpl(
singletonMap(rootFieldName, executionResult.getData()),
executionResult.getErrors()
);
}

private String getRootFieldName(ExecutionStrategyParameters parameters) {
Field rootField = parameters.field().get(0);
return rootField.getAlias() != null ? rootField.getAlias() : rootField.getName();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bbakerman do you think a null check is enough, or should we check if the string is empty too?

Copy link
Member

Choose a reason for hiding this comment

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

Its probably ok but I would do both. Pretty sure null if the alias is missing but beltcs and braces

@bbakerman bbakerman merged commit fa1c048 into graphql-java:master Dec 9, 2017
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.

None yet

2 participants