Giter VIP home page Giter VIP logo

Comments (14)

FahdW avatar FahdW commented on May 22, 2024 1

@jaydenseric you can close this issue I managed to fix my issue.

from apollo-upload-client.

jaydenseric avatar jaydenseric commented on May 22, 2024

Are you using the latest versions of apollo-upload-client, and apollo-upload-server? They are using a newer version of the GraphQL multipart request spec.

from apollo-upload-client.

levvsha avatar levvsha commented on May 22, 2024

@jaydenseric Is it possible to specify the value that will replace files instead of null? Our backend is built in such a way that it produces an error if it gets an array with null values.

from apollo-upload-client.

crirus avatar crirus commented on May 22, 2024

I'm on the same boat with this, I can even accept a 'true', '1', etc, or the actual file names instead null

from apollo-upload-client.

jaydenseric avatar jaydenseric commented on May 22, 2024

I'm not sure what you guys are explaining, because upollo-upload-server processes the request for you so your resolvers don't see any null values; they get Upload scalars with stream, filename, etc.

from apollo-upload-client.

crirus avatar crirus commented on May 22, 2024

I am not using apolo-upload-server, just the client and my implementation is standard graphql that rejects queries with fields set to null :)

from apollo-upload-client.

jaydenseric avatar jaydenseric commented on May 22, 2024

@crirus You need a server implementation for the GraphQL multipart request spec running before your GraphQL server or nothing will work properly.

from apollo-upload-client.

crirus avatar crirus commented on May 22, 2024

@jaydenseric I know, we already handle your operations and maps POST keys, but inside the input query, all fields about files are set to null, hence the query is invalidated before we get control of execution in resolvers.

We could convert that input query to change the nulls, but it could be more elegant if your client send some acceptable, useful values instead.

From my point of view, you could put there an array with file names

Regards
Cristian

from apollo-upload-client.

jaydenseric avatar jaydenseric commented on May 22, 2024

@FahdW We can reopen this if you decide to answer my earlier question about what versions you are using and clarify the problem. I can't understand what your issue with apollo-upload-client actually is; the code excerpt does not have any context and does not look like a typical use of the Apollo Client API. It's also confusing what you mean by the client sending null in place of the files, since in a way that is what is meant to happen.

@crirus It seems you are trying to build a custom server implementation of the spec and are finding it challenging. The right place to discuss that is the #uploads chanel of the Apollo Slack where I would be happy to help.

from apollo-upload-client.

crirus avatar crirus commented on May 22, 2024

it's not a custom built, it's using facebook graphql protocol. Simply, if yous end a field with null, it's not accepted. Even 0 is fine.

from apollo-upload-client.

jaydenseric avatar jaydenseric commented on May 22, 2024

@crirus see jaydenseric/graphql-multipart-request-spec#4 (comment).

I think you are confused about how this ecosystem fits together.

from apollo-upload-client.

crirus avatar crirus commented on May 22, 2024

I am not, neither you are: basically you use null, graphql is not accepting it. I don't know why is a problem (if is a problem) to put anything there but null. :)

from apollo-upload-client.

jaydenseric avatar jaydenseric commented on May 22, 2024

Your GraphQL server should never receive a null value, because you should have middleware that decodes the multipart request according to the spec, and creates the standard input the GraphQL server expects to consume later in the middleware chain.

I'm guessing that because you have not setup apollo-upload-server as per the instructions, you must have a non-Node.js environment. There are other server implementations for PHP and Ruby you can try.

from apollo-upload-client.

crirus avatar crirus commented on May 22, 2024

I know, exactly this is happening, we have a middleware to deal with this special POST format, we also replace those nulls, but we could avoid looping through all the queries, if client would send something else.

from apollo-upload-client.

Related Issues (20)

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.