-
Notifications
You must be signed in to change notification settings - Fork 21
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
See GraphQL operationName in Network tab list #112
Comments
Hi! CCing @janodvarko to weigh in on this :) |
@peteruithoven can you please point me to a page I could load on my machine and see live how the GraphQL HTTP requests look like in the Network panel? (to see what you see) Honza |
Yes! :) One of the great examples is probably the github Graphql explorer. Just login and press the execute (play icon) button. Some simple query examples: query repositories {
viewer {
repositories (last:5) {
nodes {
name
createdAt
}
}
}
} query gists {
viewer {
gists(last:5){
nodes {
name
createdAt
url
}
}
}
} Another fun example: query heroAndFriends{
hero(episode:JEDI) {
name
appearsIn
friends {
name
}
}
} Short GraphQL intro's: General GraphQL tutorial: |
Thanks! So the Example:
Is there any other way how to pass the So, we could potentially introduce a new custom column that is showing a field from POST data. Something similar what we have for Response headers But, not sure how the UI would look like. How the user would specify what exact field should be rendered in that column. @digitarald @bomsy @fvsch WDYT? Honza |
This is tricky because most users will be using existing libraries like the Apollo client which handles this part. |
So, if I understand correctly, it's usually (or only?) sent through the request payload (POST data) as JSON? The Apollo client does that? (I can't load the link you provided) |
Yes this is definitely the most common approach. Exceptions are optimizations that are Apollo specific, which as far as I understand it expand on the GraphQL specification. For example by sending multiple queries in a batched request or sending queries as a get request. More info:
Yes you mostly give those queries like I shared earlier to that client and the Apollo client will send out the right requests. (It won't if the data is available in it's cache) |
If we want to hardcode basic GraphQL support in Netmonitor, I'm seeing a couple options:
One issue with (1) is that it doesn't help discoverability. Ideally developpers debugging a page using GraphQL should see some info directly without having to know that DevTools can do more for them if they right-click the headers and activate some setting. We could perhaps overload the "File" column to show GraphQL info.
and we could show:
Would that be helpful? Note that the |
A GraphQL tab could show an accordion with a few sections:
(Not sure about the order.) But maybe that's not super useful when we already have the Params and Response tabs, and there are extensions like Apollo DevTools around too. |
A GraphQL specific tab wouldn't add that much I think. But I love the Both would also enable expansion towards the future in how you determine the operation name. You could for example later on add support for those GET requests. |
Thank you @peteruithoven for all the details. I have seen GraphQL come up as a pain point. Maybe @wesbos has ideas here as well. Seems like there are 2 main problems: 1. How to extract & display the
|
So far I filed Bug 1618733 - |
I like the idea to use similar UI for adding a custom column that would show data from any part of an HTTP request (response body, request body, query string, etc.). We could have just one UI that allows to specify the data source (request, response, etc.) as well as the data point within the source (e.g. We could use the HAR format to specify the entire data path. (e.g. This could help to debug any REST based service. Honza |
Even when the |
Yes. What I have in mind is to use HAR path to specify the Perhaps my example could improved: Instead of Honza |
Currently when working with GraphQL all the request look the same and there are no columns I could add to help me differentiate them.
Ideally I can see the Operation name that can be defined per GraphQL request:
From: https://blog.apollographql.com/the-anatomy-of-a-graphql-query-6dffa9e9e747
This usually is added to a request as is a property of json params:
There are GraphQL specific tools, but ideally this information can be seen where I also see other network communication related information.
The text was updated successfully, but these errors were encountered: