Giter VIP home page Giter VIP logo

Comments (12)

hongbo-miao avatar hongbo-miao commented on August 26, 2024 1

Thanks for sharing!

from xkojimedia.github.io.

imolorhe avatar imolorhe commented on August 26, 2024 1

@Justas-Kaulakis you would have to split out your input object. Following the example you shared,

input MemberInput {
  fullName: String!
  description: String!
  image: Upload
}

mutation CreateMember($fullName: String!, $description: String!, $image: Upload) {
  createMember(input: {
    fullName: $fullName,
    description: $description,
    image: $image
  }) {
    id
    fullName
    imageId
    description
    createdAt
  }
}

from xkojimedia.github.io.

Oluwasetemi avatar Oluwasetemi commented on August 26, 2024

Thank you so much for writing this and creating altair. I was able to figure out the file upload to work on one of my projects.

from xkojimedia.github.io.

imolorhe avatar imolorhe commented on August 26, 2024

Awesome! Glad it helped.

from xkojimedia.github.io.

muco-rolle avatar muco-rolle commented on August 26, 2024

Thank you creating Altair it's really awesome one of the reasons I used is because it provides way to upload files but when the window opens for choosing the in file explorer we can't see the normal file explorer interface like texts are in form of squares I'm using Manjaro distro

from xkojimedia.github.io.

imolorhe avatar imolorhe commented on August 26, 2024

Hey! Sorry to hear that. You can create an issue in the repo with more details including screenshots so we can discuss it in more details πŸ™‚ https://github.com/imolorhe/altair/issues

from xkojimedia.github.io.

wangxinru avatar wangxinru commented on August 26, 2024

if I want send other formdata how can I write graphql with Altair?
mutation($file:[Upload]){
createDocument(multipartBody:$file){
documentName
fileDownloadUrl
}
}
like this only upload file

from xkojimedia.github.io.

imolorhe avatar imolorhe commented on August 26, 2024

@wangxinru how do you mean other form data? Is this other form data supported in the GraphQL spec? The file upload implementation is a specific spec for file upload support. I'm not aware of any other form data related specifications.

from xkojimedia.github.io.

Justas-Kaulakis avatar Justas-Kaulakis commented on August 26, 2024

Great docs!
Im just not sure how to name the "file name" input if my mutation accepts an object containing the file as a parameter?

input MemberInput {
fullName: String!
description: String!
image: Upload
}

mutation CreateMember($input: MemberInput!) {
createMember(input: $input) {
id
fullName
imageId
description
createdAt
}
}

from xkojimedia.github.io.

automi0919 avatar automi0919 commented on August 26, 2024

Unhandled Rejection (Error): Validation error of type VariableTypeMismatch: Variable type 'Upload' doesn't match expected type '[Upload]' @ 'createUploadCoverImage'

When I use this , I get this error

from xkojimedia.github.io.

imolorhe avatar imolorhe commented on August 26, 2024

@webDeveloper-619 you're mixing the Upload type with the list form [Upload] which is used for multiple uploads. You can try using the little toggle button beside the file name to switch between single file mode Upload and multiple file mode [Upload]

from xkojimedia.github.io.

saurabhkala1990 avatar saurabhkala1990 commented on August 26, 2024

Can you please share how the SDL looks like in the case of file upload. I created a custom scalar type and defined that with MultipartFile and getting 422 unprocessed entity error when trying to hit from Altair

from xkojimedia.github.io.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.