Skip to content

Refactor GraphQL#execute implementation#509

Merged
bbakerman merged 1 commit into
graphql-java:masterfrom
tklovett:graphql-execute-refactor
Jun 21, 2017
Merged

Refactor GraphQL#execute implementation#509
bbakerman merged 1 commit into
graphql-java:masterfrom
tklovett:graphql-execute-refactor

Conversation

@tklovett

Copy link
Copy Markdown
Contributor

The goal here was to

  • Hide implementation details in sub-methods, which should
  • Make it easier to understand what is happening from a quick read, and
  • Make the lifecycle of the instrumentation instances easy to see and validate

I believe that I have not significantly changed when or under what conditions the onEnd instrumentation methods are called. Its worth noting that the onEnd methods are not guaranteed to be called in all possible error scenarios.

@bbakerman bbakerman 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.

I am happy to accept this one with the method rename

(which is a minor thing to be honest)

Comment thread src/main/java/graphql/GraphQL.java Outdated

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.

Can we call this getDocument please

nit: no need for public modifier on private class

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is fixed in 0b85a3b

@tklovett tklovett force-pushed the graphql-execute-refactor branch from 0c0fdb0 to 0b85a3b Compare June 19, 2017 16:20
Execution execution = new Execution(queryStrategy, mutationStrategy, subscriptionStrategy, instrumentation);
ExecutionResult result = execution.execute(executionId, graphQLSchema, context, root, document, operationName, variables);
ExecutionId executionId = idProvider.provide(query, operationName, context);
return execution.execute(document, graphQLSchema, executionId, executionInput);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This @Internal API change (and corresponding changes in Execution and ExecutionTest) is new in this amended commit and was not previously reviewed.

final Object context = executionInput.getContext();
final Object root = executionInput.getRoot();
final String operationName = executionInput.getOperationName();
final Map<String, Object> variables = executionInput.getVariables();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These can be inlined if you like, but will then cause merge conflicts with #508

@bbakerman bbakerman merged commit a71d072 into graphql-java:master Jun 21, 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.

3 participants