Comments (14)
@jaydenseric you can close this issue I managed to fix my issue.
from apollo-upload-client.
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.
@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.
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.
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.
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.
@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.
@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.
@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.
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.
@crirus see jaydenseric/graphql-multipart-request-spec#4 (comment).
I think you are confused about how this ecosystem fits together.
from apollo-upload-client.
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.
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.
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)
- Module not found - after updating to 18.0.1 HOT 2
- Problem with Typescript HOT 2
- Document required TypeScript libs HOT 1
- How do you use ReactNativeFile in the latest version HOT 3
- Error with Vite HOT 1
- Failed to resolve entry for package "apollo-upload-client". HOT 2
- Support for @defer directive?
- Version 18 doesn't work with React Native HOT 2
- Module not found HOT 2
- Broken compatibility with HotChocolate 13.2 -> HOT 1
- Why js instead of ts? HOT 3
- Version 18 incompatible with Next.js HOT 3
- Support with @habx/apollo-multi-endpoint-link HOT 2
- Query on Compatibility with @apollo/client 3.9.0 and apollo-upload-client HOT 1
- Pending requests issue HOT 2
- importing the library in react js project HOT 1
- "Reached maximum amount of queued data" in Safari HOT 2
- Must provide query string HOT 3
- Can this lib provider `typings` HOT 4
- ReactNativeFile HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo-upload-client.