-
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
GraphiQL question/feature request: show graphql endpoint being queried #2549
Comments
This might be good to consider as a 3.0.0 feature. The current API doesn't allow users to specify a UI directly, instead the This would work if, for example a simple |
Hey @joshft91 👋 just wanna ask a clarifying question: Is your feature request just about showing the one URL that's used to send queries to? Or is it about adding support for querying multiple endpoints in a single instance of GraphiQL? |
Hey @acao and @thomasheyenbrock 👋 - thanks for the responses! Good clarifying question - I was in the middle of a response to do just that. While I like the idea of querying multiple endpoints, my request/question was simpler (famous last words): display/show (read only) the URL that's configured in the I believe this could even tie in with #2485 which seems like it's basically asking for a refresh button to trigger the introspection query. Something like what GraphQL Playground does now, just without the ability to specify a different endpoint. Hope that makes sense! |
Thanks for clarifying 🙌 We'll implement schema reloading with the new design that will ship with v2. The button for that will likely be placed in a menu or dialog. There will also be a keyboard shortcut for that (probably @acao Sounds like we won't need a new major for that, so labeling this just as "enhancement". |
@thomasheyenbrock another pattern we can borrow from GraphQLPlayground is multiple service-layer components, which it seems you're already moving to to some degree.
For later major versions, 4 or 5 even at this point, it could eventually be something like this, like playground but with plugins. Perhaps the const token = import.meta.env.TOKEN
// we could even adhere to `graphql-config` format, which this is an adaptation of
const projects = [
{
name: "local", schema: "localhost:3000/graphql"
},
{
name: "stage",
schema: "https://myschema.com/graphql",
headers: { Authorization: `bearer ${token}` }
}
]
<GraphiQLEditor
projects={projects}
settings={/* JSON string like playground or perhaps object */}
plugins={/*array of components and/or modules definitions or objects*/}
/> which opens us to other playground-esque service layers for server middlewares and beyond! Then you open up so many options if we have some degree of |
playground has so many great service layer design patterns that I want to clone for the more modern era haha! but one at a time, one at a time |
@acao great ideas! But should we keep this issue scoped for now on showing the endpoint somewhere in the design and open up another one that focusses on multi-project support? (Maybe there already is one?) |
Actually if I may I'd like to put in a vote for supporting querying multiple endpoints in a single GraphiQL instance. That would be super useful! |
That is part of this feature request! Lets track it here, since it documents the architectural changes needed to achieve this @thomasheyenbrock in order to even show the url, we will need to make |
My team is currently using GraphQL Playground that's shipped with Apollo Server, but due to the fact that Playground is no longer maintained and GraphiQL is now preferred, we are looking to switch. I'm currently running GraphiQL locally as outlined here.
One thing I appreciated about the GraphQL Playground is the ability to see which GraphQL endpoint was being hit/queried as seen in the screenshot below. Is this possible in GraphiQL or GraphiQL v2 that is being worked on?
If this wasn't the appropriate place to ask let me know and I can direct my question appropriately. Thank you!
The text was updated successfully, but these errors were encountered: