Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test mutation with input type Upload

See original GitHub issue

Hi, I want to test my mutation which have input type Upload. How to do that with EasyGraphQL?

I know we can pass the expected input on the third parameter (after Call test from tester).

const EasyGraphQLTester = require('easygraphql-tester')
const fs = require('fs')
const path = require('path')

const schemaCode = fs.readFileSync(path.join(__dirname, 'schema', 'schema.gql'), 'utf8')
const tester = new EasyGraphQLTester(schemaCode)

const mutation = `
  mutation CreateUser{
    createUser {
tester.test(true, mutation, {
  banner: '',
  username: 'test',
  fullName: 'test',
  password: 'test'

on that above case… if banner is input type Upload, how to do that in easygraphql?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

IvanVilla1585commented, Jun 30, 2019

@harked @estrada9166 I’m working on it.

harkedcommented, Aug 27, 2021

@estrada9166 sorry for so late reply. It works for me. Thanks. I’ll close this issue now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mutations and Input Types - GraphQL
It's often convenient to have a mutation that maps to a database create or update operation, like setMessage , return the same thing...
Read more >
File uploads - Apollo GraphQL Docs
WARNING: The file upload mechanism described in this file (which we removed in Apollo Server 3) inherently exposes your server to CSRF mutation...
Read more >
Input object type as an argument for GraphQL mutations and ...
We will concentrate on the often misunderstood topic of using GraphQL input object types in mutations. Input and output types. According to GraphQL ......
Read more >
Can Upload scalar be part of a GraphQL input type? #117
Hello. This is shown as an example for uploading schema: type File { id: ID! path: String! filename: String! mimetype: String! }
Read more >
How to upload files in a GraphQL mutation nested inputs?
input PostInputs { id: ID! name: String! images: [ImageInputs!]! } input ImageInputs { id: ID! file: Upload! alt_name: String! } type Mutation { ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found