Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit b2f7297

Browse files
committed
Simplify getGraphQLParams
1 parent 205c859 commit b2f7297

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/index.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -460,20 +460,9 @@ export type GraphQLParams = {|
460460
export async function getGraphQLParams(
461461
request: $Request,
462462
): Promise<GraphQLParams> {
463-
const { url = '' } = request;
464-
const urlData = new URLSearchParams(url.split('?')[1]);
463+
const urlData = new URLSearchParams(request.url.split('?')[1]);
465464
const bodyData = await parseBody(request);
466465

467-
return parseGraphQLParams(urlData, bodyData);
468-
}
469-
470-
/**
471-
* Helper function to get the GraphQL params from the request.
472-
*/
473-
function parseGraphQLParams(
474-
urlData: URLSearchParams,
475-
bodyData: { [param: string]: mixed, ... },
476-
): GraphQLParams {
477466
// GraphQL Query string.
478467
let query = urlData.get('query') ?? bodyData.query;
479468
if (typeof query !== 'string') {

0 commit comments

Comments
 (0)