graphql-multipart-request-spec
apollo-server
Our great sponsors
graphql-multipart-request-spec | apollo-server | |
---|---|---|
11 | 66 | |
981 | 13,663 | |
- | 0.2% | |
1.5 | 9.1 | |
about 1 month ago | 2 days ago | |
TypeScript | ||
- | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
graphql-multipart-request-spec
-
How can I upload a file in the GraphQL PLayground?
The GraphQL specification itself doesn't natively support file uploads, so the solution typically involves using extensions or additional libraries. The easiest and most straightforward way is by converting the file to Base64 before sending it to the server, you can include it as a string in the GraphQL request. This offcourse has a downside, it can increase the payload size, so it may not be the most efficient solution for large files. Other options that involve using extensions or additional libraries are using GraphQL multipart request specification and Apollo Server with Apollo Upload Client
-
GraphQL - From Excitement to Deception
Also, we manage to upload files via GraphQL just fine. Turns out nothing prevents you from putting a GraphQL query in a multipart form. Frameworks support this just fine, and if not, just write your own middleware, it's not even that hard.
-
Is it possible to pass CSV data to a mutation as an input parameter?
There is a specification (and implementation) for sending files through GraphQL. https://github.com/jaydenseric/graphql-multipart-request-spec
-
Forging GraphQL Bombs, the 2022 version of Zip Bombs
We figured out that it was possible to reference a file several times by implementing the reference spec (https://github.com/jaydenseric/graphql-multipart-request-spec) for both a client and a server. We have no record of this vulnerability used in the wild, but we know for sure that a lot of popular projects on GitHub are vulnerable.
The GraphQL multipart specification describes how to implement file uploads in GraphQL. While usual GraphQL queries are sent as application/json, file uploads are sent as multipart/form-data. This means that the HTTP request body has multiple parts, and their functions, described in the specification, can be summarized as follows:
-
How to set file data in GraphQL variables?
Hey, graphql-upload works on top of the graphql-multipart-request-spec, of which you can find the specification here.
-
How to Upload a file to GraphQL with VanillaJS
In this article you will learn the widely accepted method of implementing file upload which is becoming increasingly popular in new apps. The technique follows the specification by @jaydenseric.
-
Announcing GraphQL Yoga 2.0!
GraphQL-Multipart-Request: enables great file upload support.
-
GraphQL Tools V8 - Stitch Federation Services
Multipart File Uploads āļø
-
The Stack #3
One important thing which GraphQL Spec did not discuss about is a way to transmit files over the wire when using GraphQL. This is where GraphQL Upload comes in. While not an official spec from GraphQL foundation, Jayden had done a great job to put together a multi part spec to address exactly this problem.
apollo-server
-
React Server Components Example with Next.js
Another interesting point is that executing fetches on the server can allow developers to more easily leverage caching. Next.js already handles caching out-of-the-box and Iām curious to see if the wider adoption of RSC reduces the need to combine React with solutions like Apollo Server and Apollo Client. While there are other benefits to these tools, RSC could provide similar caching behavior without the need to invest in a GraphQL solution.
-
Building Scalable GraphQL Microservices With Node.js and Docker: A Comprehensive Guide
There are several GraphQL server implementations, however, for this tutorial, we'll utilize Apollo GraphQL's Apollo Server, a lightweight and flexible JavaScript server that makes it easy to build GraphQL APIs.
-
Launch HN: Serra (YC S23) ā Open-source, Python-based dbt alternative
As I mentioned, their main GraphQL server package is[1], so that's where the confusion came from. Thanks.
[1] https://github.com/apollographql/apollo-server/blob/9817bc47...
-
Who moved my error codes? Adding error types to your GoLang GraphQL Server
While working on this blog post, I learned that Apollo Server, the most popular GraphQL server for typescript, uses a similar method for adding error codes to GraphQL. It even lets you add custom errors. Hopefully, someday other GraphQL server projects will follow them. Until then, weāve got a strong indication we took the right approach.
-
Zero to Serverless Car Insurance - Part 2
GraphQL is just a schema, there are many different implementations of a GraphQL server, AppSync being one of them. I mentioned Apollo server in this series as well.
- How can i do query directives or executable directives?
-
How we migrated to Apollo Server 4
After some head-scratching, I opened an issue on Apollo Serverās GitHub repository. There, Apollo Server contributor @āglasser shared a helpful suggestion: why not invoke our AuthPlugin from Apollo Serverās context function? Throwing from context would ensure we can control the HTTP status response without having to introduce more methods and error checks to our AuthPlugin (like unexpectedErrorProcessingRequest). With that suggestion in mind, we rewrote our AuthPlugin as follows:
-
why would a developer choose nodejs over c#.net for backend?
Apollo as a middleware in Express.js, actually.
-
Using Postman and Postman Interceptor to authenticate a session cookie based GraphQL API
Apollo Server 3 Cookie Issue #5775
-
Custom API server with basic CRUD ā Apollo, GraphQL & MongoDB
Lastly, instead of writing our API core ourselves, we'll be using the star of this episodeā---āApollo Server (a.k.a. GraphQL server). It has detailed documentation available here.
What are some alternatives?
graphql-tools - :wrench: Utility library for GraphQL to build, stitch and mock GraphQL schemas in the SDL-first approach
mercurius - Implement GraphQL servers and gateways with Fastify
altair - āØā”ļø A beautiful feature-rich GraphQL Client for all platforms.
graphql-mesh - The Graph of Everything - Federated architecture for any API service
graphiql - GraphiQL & the GraphQL LSP Reference Ecosystem for building browser & IDE tools.
nestjs-graphql - GraphQL (TypeScript) module for Nest framework (node.js) š·
graphql-live-query - Realtime GraphQL Live Queries with JavaScript
graphql-yoga - š§ Rewrite of a fully-featured GraphQL Server with focus on easy setup, performance & great developer experience. The core of Yoga implements WHATWG Fetch API and can run/deploy on any JS environment.
insomnia - The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
express-graphql - Create a GraphQL HTTP server with Express.
graphql-editor - šŗ Visual Editor & GraphQL IDE.
graphql-ws - Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client.