-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add @graphiql/plugin-batch-request #2994
base: main
Are you sure you want to change the base?
Conversation
|
|
thanks for this PR! it seems this plugin uses some non-public module sources currently. do you have an NPM version of these packages available?
|
Hi @acao yes, sorry! forgot to switch the npm registry, will apply the changes, along with some fixes regarding building the payload for the HTTP request. will push registry changes along with other fixes. |
@acao i just make the changes, also update the README.md |
Hi all, an update here!, just added an option to also batch using aliases, took the batching algorithm from https://github.com/ardatan/graphql-tools/blob/master/packages/batch-execute/src/mergeRequests.ts |
Hi everyone, just circling back here, would it still make sense to have this plugin ? we are already using it but publishing it internally. We believe that this is something that could benefit the GraphQL community |
Hey @samuelAndalon 👋 this plugin looks nothing short of awesome 😍 props for putting that together 👏 I do believe that this plugin is meaningful and probably delivers value also for other folks. I'm just not sure if this repo is the right place for it. A main motivator for introducing plugins was to enable folks to build and maintain their own things without us needing to build all feature requests first-class into GraphiQL. We do have some plugins (the explorer and code exporter) which are fairly general purpose and should also give an example of what you can build with the plugin API. However, I do not think that all plugins should live in this repository. In particular, plugins that are opinionated or that focus on supporting GraphQL features that are not (yet) part of the latest spec version should not be maintained in this repo. This plugin doesn't match with that as batched requests are an extension of GraphQL that is not part of the spec. This is my personal opinion and we haven't aligned on this yet as maintainers, so I encourage other opinions here (cc @acao and @jonathanawesome, we could also discuss that in future working group sessions if desired). I can definitely encourage you to publish this publicly on your end and share it with the community for now ⭐ that way you can share this with a broader audience until we figured out our strategy on which plugins should be maintained by us and which shouldn't. |
I think this is awesome! But I would rather see |
Description
Hi all, this is Sam from Expedia Group, we recently added graphiql to graphql-kotlin with explorer and exporter plugin, at EG we heavily rely on batched requests from clients to GraphQL servers.
The
graphiql@2
plugin API gave us an idea of a plugin that we really need, a way to create batched requests from an IDE, as currently playground, graphiql, insomina, postman offer that capabilty, forcing us to use raw http clients to make some requests for testing.This PR that adds a batch-request plugin, relies on the
editorContext
to access to tabs and operations on each tab, then it presents the operations in a file tree format to have user to select which operations are going to be sent in a batch.Please let us know your feedback and if this is indeed a candidate for a plugin.
Couple of notes:
aliasing
andarrays
(server requires to be configured for array inputs).graphql-results
mode, as setting the batch response array in response editor causes some parsing issues.Demo video:
batch-plugin-demo.mov