Alex Kondratiuk

Results 27 comments of Alex Kondratiuk

@kettanaito I've expected graphql upload to work since https://github.com/mswjs/msw/pull/543 is merged. In a real scenario I can't send a JSON since I'm using external library for sending graphql requests which...

I've been experimenting with different FormData polyfills. Here are my observations: ## @jest-environment node ```ts import { readFileSync } from 'fs' import FormData from 'form-data' import { graphql, rest }...

Also here's the example how it works without `threads.js` using vanilla `worker_threads`: https://github.com/lynxtaa/threads-ts-node-esm-issue/tree/no-threads

@gblikas In graphql-request there is a heuristic for detecting files in variables https://github.com/prisma-labs/graphql-request/blob/a6d1365ae0fc6694c45ea404e4a44b93a8c06479/src/createRequestBody.ts#L10 it supports instances of File and Blob and duck-types NodeJS streams. Does it work without `typescript-graphql-request`? Sorry,...

@gblikas Could you create a repository with a minimal reproduction of this issue? I'll look into it P.S. `awesome-graphql-client` can be used with generated types via [TypedDocumentNode](https://github.com/lynxtaa/awesome-graphql-client#typescript-with-typeddocumentnode-even-better). But all the...

Also I noticed that `graphql-request` uses [form-data](https://www.npmjs.com/package/form-data) package for NodeJS which is highly popular but not spec-compliant and its usage is discouraged https://github.com/node-fetch/node-fetch/pull/1212

@gblikas 1. You shouldn't set Content-Type header when sending multipart/form-data via fetch. Fetch by spec must set Content-Type to `multipart/form-data; boundary=`, followed by the multipart/form-data boundary string generated by the...

@gblikas I'm glad it helped! > @lynxtaa For next time, where could I have found better documentation around how to upload a file using graphql-request? Uploading a file progamatically, via...

I've created PR to solve this issue https://github.com/prisma-labs/graphql-request/pull/175

Meanwhile I've published https://www.npmjs.com/package/awesome-graphql-client with GraphQL Upload support in NodeJS and browsers which also solves https://github.com/prisma-labs/graphql-request/issues/61 and https://github.com/prisma-labs/graphql-request/issues/10 Hope you enjoy!