Closed osipMax closed 2 years ago
I've updated imports to current version but it didn't help
import { FileUpload, GraphQLUpload } from 'graphql-upload/GraphQLUpload.js';
It needs to be like this (assuming your are using TypeScript to compile this code):
import GraphQLUpload from "graphql-upload/GraphQLUpload.js";
import type { FileUpload } from "graphql-upload/processRequest.js";
Hope that helps :)
@jaydenseric thanks for keeping up with all of us having trouble with the module change.
I almost opened an issue just like this one when I couldn't get the new module changes to work in my project, but found there was one last tsconfig setting I needed: allowJs: true
- perhaps recommend that to anyone having trouble with types after making the changes to imports and uninstalling @types/graphql-upload.
@werkshy you might need that if you are using tsconfig.json
; if you are using jsconfig.json
TypeScript automatically sets allowJs
to true
for you:
https://code.visualstudio.com/docs/languages/jsconfig#_what-is-jsconfigjson
I use jsconfig.json
in my projects because I only use JavaScript files (.js
/.mjs
) and don't use .ts
/.mts
/.cts
with a compile step.
Hi! Thanks for spending your time on this module! I'm working with NestJS and Graphql and I need to upload files to Apollo Server. But after changing this package graphql showing this error
Error: Cannot determine a GraphQL input type nullfor the "file".
So can you help me, how should I specify the type of file in this case? Before updating to version v15 all worked as expected
I've updated imports to current version but it didn't help
import { FileUpload, GraphQLUpload } from 'graphql-upload/GraphQLUpload.js';