src/Rebing/GraphQL/GraphQLUploadMiddleware.php
private function validateParsedBody(Request $request)
    {
        $bodyParams = $request->all();

        if (null === $bodyParams) {
            throw new InvariantViolation(
                'Request is expected to provide parsed body for "multipart/form-data" requests but got null'
            );
        }

        if (!is_array($bodyParams)) {
            throw new RequestError(
                'GraphQL Server expects JSON object or array, but got ' . Utils::printSafeJson($bodyParams)
            );
        }

        if (empty($bodyParams)) {
            throw new InvariantViolation(
                'Request is expected to provide parsed body for "multipart/form-data" requests but got empty array'
            );
        }
    }
private function validateParsedBody(Request $request)
    {
        $bodyParams = $request->all();

        if (null === $bodyParams) {
            throw new InvariantViolation(
                'Request is expected to provide parsed body for "multipart/form-data" requests but got null'
            );
        }

        if (!is_array($bodyParams)) {
            throw new RequestError(
                'GraphQL Server expects JSON object or array, but got ' . Utils::printSafeJson($bodyParams)
            );
        }

        if (empty($bodyParams)) {
            throw new InvariantViolation(
                'Request is expected to provide parsed body for "multipart/form-data" requests but got empty array'
            );
        }
    }
private function validateParsedBody ( Request $ request ) { $ bodyParams = $ request -> all ( ) ; if ( null === $ bodyParams ) { throw new InvariantViolation ( 'Request is expected to provide parsed body for "multipart/form-data" requests but got null' ) ; } if ( ! is_array ( $ bodyParams ) ) { throw new RequestError ( 'GraphQL Server expects JSON object or array, but got ' . Utils :: printSafeJson ( $ bodyParams ) ) ; } if ( empty ( $ bodyParams ) ) { throw new InvariantViolation ( 'Request is expected to provide parsed body for "multipart/form-data" requests but got empty array' ) ; } }
Validates that the request meet our expectations

@param  \Illuminate\Http\Request  $request
Validates that the request meet our expectations