55import graphql .ExecutionResult ;
66import graphql .introspection .IntrospectionQuery ;
77import graphql .schema .GraphQLFieldDefinition ;
8+ import graphql .servlet .config .GraphQLConfiguration ;
9+ import graphql .servlet .context .ContextSetting ;
810import graphql .servlet .core .GraphQLMBean ;
911import graphql .servlet .core .GraphQLObjectMapper ;
1012import graphql .servlet .core .GraphQLQueryInvoker ;
1113import graphql .servlet .core .GraphQLServletListener ;
12- import graphql .servlet .config . GraphQLConfiguration ;
13- import graphql .servlet .context . ContextSetting ;
14+ import graphql .servlet .core . internal . GraphQLRequest ;
15+ import graphql .servlet .core . internal . VariableMapper ;
1416import graphql .servlet .input .BatchInputPreProcessResult ;
1517import graphql .servlet .input .BatchInputPreProcessor ;
1618import graphql .servlet .input .GraphQLBatchedInvocationInput ;
17- import graphql .servlet .input .GraphQLSingleInvocationInput ;
1819import graphql .servlet .input .GraphQLInvocationInputFactory ;
19- import graphql .servlet .core .internal .GraphQLRequest ;
20- import graphql .servlet .core .internal .VariableMapper ;
20+ import graphql .servlet .input .GraphQLSingleInvocationInput ;
2121import org .reactivestreams .Publisher ;
2222import org .reactivestreams .Subscriber ;
2323import org .reactivestreams .Subscription ;
@@ -136,15 +136,15 @@ public void init() {
136136 }
137137 if (path .contentEquals ("/schema.json" )) {
138138 query (queryInvoker , graphQLObjectMapper , invocationInputFactory .create (INTROSPECTION_REQUEST , request , response ),
139- request , response );
139+ request , response );
140140 } else {
141141 String query = request .getParameter ("query" );
142142 if (query != null ) {
143143
144144 if (isBatchedQuery (query )) {
145145 List <GraphQLRequest > requests = graphQLObjectMapper .readBatchedGraphQLRequest (query );
146146 GraphQLBatchedInvocationInput batchedInvocationInput =
147- invocationInputFactory .createReadOnly (configuration .getContextSetting (), requests , request , response );
147+ invocationInputFactory .createReadOnly (configuration .getContextSetting (), requests , request , response );
148148 queryBatched (queryInvoker , batchedInvocationInput , request , response , configuration );
149149 } else {
150150 final Map <String , Object > variables = new HashMap <>();
@@ -155,8 +155,8 @@ public void init() {
155155 String operationName = request .getParameter ("operationName" );
156156
157157 query (queryInvoker , graphQLObjectMapper ,
158- invocationInputFactory .createReadOnly (new GraphQLRequest (query , variables , operationName ), request , response ),
159- request , response );
158+ invocationInputFactory .createReadOnly (new GraphQLRequest (query , variables , operationName ), request , response ),
159+ request , response );
160160 }
161161 } else {
162162 response .setStatus (STATUS_BAD_REQUEST );
@@ -174,8 +174,8 @@ public void init() {
174174 if (APPLICATION_GRAPHQL .equals (request .getContentType ())) {
175175 String query = CharStreams .toString (request .getReader ());
176176 query (queryInvoker , graphQLObjectMapper ,
177- invocationInputFactory .create (new GraphQLRequest (query , null , null ), request , response ),
178- request , response );
177+ invocationInputFactory .create (new GraphQLRequest (query , null , null ), request , response ),
178+ request , response );
179179 } else if (request .getContentType () != null && request .getContentType ().startsWith ("multipart/form-data" ) && !request .getParts ().isEmpty ()) {
180180 final Map <String , List <Part >> fileItems = request .getParts ()
181181 .stream ()
@@ -203,7 +203,7 @@ public void init() {
203203 graphQLObjectMapper .readBatchedGraphQLRequest (inputStream );
204204 variablesMap .ifPresent (map -> graphQLRequests .forEach (r -> mapMultipartVariables (r , map , fileItems )));
205205 GraphQLBatchedInvocationInput batchedInvocationInput = invocationInputFactory .create (configuration .getContextSetting (),
206- graphQLRequests , request , response );
206+ graphQLRequests , request , response );
207207 queryBatched (queryInvoker , batchedInvocationInput , request , response , configuration );
208208 return ;
209209 } else {
@@ -231,7 +231,7 @@ public void init() {
231231 if (isBatchedQuery (inputStream )) {
232232 List <GraphQLRequest > requests = graphQLObjectMapper .readBatchedGraphQLRequest (inputStream );
233233 GraphQLBatchedInvocationInput batchedInvocationInput =
234- invocationInputFactory .create (configuration .getContextSetting (), requests , request , response );
234+ invocationInputFactory .create (configuration .getContextSetting (), requests , request , response );
235235 queryBatched (queryInvoker , batchedInvocationInput , request , response , configuration );
236236 } else {
237237 query (queryInvoker , graphQLObjectMapper , invocationInputFactory .create (graphQLObjectMapper .readGraphQLRequest (inputStream ), request , response ), request , response );
@@ -244,9 +244,9 @@ public void init() {
244244 };
245245 }
246246
247- private static InputStream asMarkableInputStream (InputStream inputStream ) {
247+ private InputStream asMarkableInputStream (InputStream inputStream ) {
248248 if (!inputStream .markSupported ()) {
249- inputStream = new BufferedInputStream (inputStream );
249+ return new BufferedInputStream (inputStream );
250250 }
251251 return inputStream ;
252252 }
@@ -409,7 +409,7 @@ private void queryBatched(GraphQLQueryInvoker queryInvoker, GraphQLBatchedInvoca
409409 BatchInputPreProcessResult batchInputPreProcessResult = batchInputPreProcessor .preProcessBatch (batchedInvocationInput , request , response );
410410 if (batchInputPreProcessResult .isExecutable ()) {
411411 List <ExecutionResult > results = queryInvoker .query (batchInputPreProcessResult .getBatchedInvocationInput ().getExecutionInputs (),
412- contextSetting );
412+ contextSetting );
413413 response .setContentType (AbstractGraphQLHttpServlet .APPLICATION_JSON_UTF8 );
414414 response .setStatus (AbstractGraphQLHttpServlet .STATUS_OK );
415415 Writer writer = response .getWriter ();
0 commit comments