r/node • u/oczekkk • Jun 26 '19
Postman now supports GraphQL
https://blog.graphqleditor.com/graphql-postman/6
10
1
Jun 27 '19
Anyone in the ether demonstrating automation of the new feature set that is dependent on GraphQL for their app testing? I don't use it but want to learn, any takers?
0
u/Wirukasu Jun 26 '19
Can someone explain to me: is postman's function not basically what graphiql provides?
4
u/tenfingerperson Jun 27 '19
No context switching. Plus it is a more consolidated tool. I personally have to deal with rest, graphql, and a proprietary http based protocol on both dev and production environments, it’s good to have everything on the same place and to have a history to track
2
u/Wirukasu Jun 27 '19
Yeah other comments have led me to realizing that postman ends up being a really useful one stop shop for a lot of projects.
3
Jun 26 '19
Have you used Postman? It’s a tool for helping you test/view what an endpoint brings back. Until now I’d only used it for testing REST endpoints. Now you can use it to test graphql endpoints.
1
u/Wirukasu Jun 26 '19
But that's what graphiql does. If you're using graphql in a project, why would you need postman when graphiql generally comes bundled with graphql?
11
u/stuckinmotion Jun 26 '19 edited Jun 26 '19
One thing we've found lacking in graphiql is changing headers. It's something they feel doesn't belong in the tool and suggest users need to find their own solution.
Another thing would be organizing multiple queries into a collection, something graphql playground does. If playground's share function worked as well as graphiql (or at all) it would prob be sufficient but so far neither tool meets all of our requirements. Postman could be a good fit in that case.
6
5
u/dominic_rj23 Jun 26 '19
Postman doesn't do something new and crazy. It inharently uses curl, so everything that can be done with postman can be done with curl too. The point of Postman is to provide an easy to use tool to test endpoints.
I think the point of supporting graphql endpoints is to recognize graphql syntax of
queryandmutations. With that postman would fit as one tool for different kind of end point testing.2
u/bullet4code Jun 27 '19
Postman doesn't use curl, it uses postman-request that they wrote. Here's the repo: https://github.com/postmanlabs/postman-request
3
Jun 26 '19
If you’re completely satisfied with all the features of graphiql you might not need Postman. I use a lot of Postmans automated testing features and use it to share collections with colleagues. If you don’t find any of Postman’s more advanced features compelling than you wouldn’t use it.
3
u/Wirukasu Jun 26 '19
Oh ok makes sense. Yeah I've used postman but not extensively, so I wasn't aware of the extra features.
1
Jun 26 '19
It was pretty key at my last job because I could literally do a smoke test of all my APIs extremely quickly.
2
1
-1
u/FirmTechnician Jun 26 '19 edited Jun 27 '19
Any reason Postman would suddenly stop recognizing any tests that I've written? My test suite is suddenly returning no results, as if there were no tests present. Not even failing.
Edit: I'm not sure why I'm getting downvoted for asking a question on a related topic?
1
u/bhargavkaranam Jun 27 '19
Do you see any errors in the Postman console? You can open it from View > Postman console. After running the tests, if there are errors, they will be logged in the console.
1
u/FirmTechnician Jun 27 '19
No, nothing appears in the console, not even a console log. If I remove all of the pm.tests, then console logs appear normally. It has only recently started and it is even affecting existing test suites I've already written for other projects that were working correctly before. This persists even after uninstall/reinstall.
1
u/HakeemLukka Jun 30 '19
Can you tell me how are you writing the tests? Are you using Chai.js structure or direct tests. You can post an example here.
-1
u/s_boli Jun 26 '19
Fi-na-l-ly !
Can ditch Insomnia now.
8
u/muukrls Jun 26 '19
What are your gripes with Insomnia? Personally I think it's quite intuitive.
6
u/TheNoim Jun 26 '19
I always felt like postman is much more messy. It really feels more intuitive to work with insomnia.
0
0
31
u/rynslmns Jun 26 '19
It’s like they are copying Insomnia, just 8 months behind :)