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

Add apollo upload server supports #288

Merged
merged 5 commits into from
Feb 12, 2018

Conversation

mcg-web
Copy link
Member

@mcg-web mcg-web commented Jan 31, 2018

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Documented? yes
Fixed tickets none
License MIT

Make this bundle request parser complient with jaydenseric/graphql-multipart-request-spec.

Unfortunately Ecodev/graphql-upload does not supports php < 7.1.

@mcg-web mcg-web force-pushed the apollo-upload-server-complient branch from ac1478e to 5db0c3f Compare January 31, 2018 18:23
@mcg-web mcg-web added this to the v0.11 milestone Jan 31, 2018
@mcg-web mcg-web force-pushed the apollo-upload-server-complient branch 5 times, most recently from cda4298 to 78c88ca Compare February 1, 2018 10:51
@mcg-web mcg-web force-pushed the apollo-upload-server-complient branch from 78c88ca to 002d0f1 Compare February 1, 2018 12:43
@@ -49,17 +51,29 @@ public function parse(Request $request)
*/
private function getParsedBody(Request $request)
{
$type = explode(';', $request->headers->get('content-type'))[0];
$contentType = explode(';', $request->headers->get('content-type'))[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

Pass 2 in the 3rd param

{
if (isset($this->config['scalarType'])) {
$scalarType = $this->config['scalarType'];
$scalarType = is_callable($scalarType) ? $scalarType() : $scalarType;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you reassign $scalarType?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because we also allow lazy loading of the scalarType config entry.

return isset($payload['operations']) && isset($payload['map']) && is_array($payload['operations']) && is_array($payload['map']);
}

protected function treatUploadFiles(array $parsedBody, array $files)
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename into handleUploadedFiles

*
* @return array
*/
protected function mappingUploadFiles(array $operations, array $map, array $files)
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename into bindUploadedFiles

@mcg-web mcg-web force-pushed the apollo-upload-server-complient branch from e24f44a to 94202e9 Compare February 5, 2018 06:47
@mcg-web mcg-web merged commit 4970332 into overblog:master Feb 12, 2018
@mcg-web mcg-web deleted the apollo-upload-server-complient branch February 12, 2018 06:12
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

3 participants