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

createReadStream is not present in uploaded image #248

Closed
BraveEvidence opened this issue Jun 5, 2021 · 1 comment
Closed

createReadStream is not present in uploaded image #248

BraveEvidence opened this issue Jun 5, 2021 · 1 comment

Comments

@BraveEvidence
Copy link

I am using node v14.17.0,"apollo-server-express": "^2.25.0", "graphql-upload": "^12.0.0"

I am trying to upload an image but i dont get createReadStream from the image which i upload from graphiql. I am using Altair graphiql

Here is my index.js

const app = express();

app.use(
  graphqlUploadExpress({
    maxFileSize: 30000000,
    maxFiles: 20,
  })
);

const server = new ApolloServer({
  typeDefs,
  resolvers,
  context: contextMiddleware,
  uploads: false,
});


server.applyMiddleware({ app });

app.listen(PORT, () => {
  console.log("Success");
});


In my typedefs i have mentioned

gql`
  scalar Upload

and my resolvers have

Upload: GraphQLUpload,

I have tried following this issue apollographql/apollo-server#3508 but it doesn't seem to work for me

My uploaded image contains following
{"filename":"download123.jpg","mimetype":"image/jpeg","encoding":"7bit"}

@jaydenseric
Copy link
Owner

I can't tell what's wrong with your project, sorry to hear you've been finding it tricky getting set up. graphql-upload is actually a pretty simple integration and it's usually problems relating to Apollo that trip people up; in such situations please refer to Apollo for help.

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

No branches or pull requests

2 participants