cancel
Showing results for 
Search instead for 
Did you mean: 

Hi Team,Can we test GraphQL request responses in SOAPUI ?

udaysqa9
New Contributor

Hi Team,Can we test GraphQL request responses in SOAPUI ?

Graphql Requests contain query string and response is in JSON.

Any options available to test this in Soap UI ?

9 REPLIES 9
nmrao
Community Hero

Re: Hi Team,Can we test GraphQL request responses in SOAPUI ?

How does a request look like?

Is it some kind of database? If so, you should be able to query it provided it has the db driver.

Any ways, provide more details of your use case.


Regards,
Rao.
udaysqa9
New Contributor

Re: Hi Team,Can we test GraphQL request responses in SOAPUI ?

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data.

 

This is similar to REST request.But we have an option to test REST and SOAP request in Soapui tool.I wanted to know if there is any option to use soapUI for testing this.

 

Example:

Graphql API request url:

http://localhost:4000/graphql?query=mutation{addCourse(title:"d",description:"d") {idtitle}}
 
Graphql Response :
 
{"data":{"addCourse":{"id":"5a17db8a36fd8f1748bf7ea0","title":"d"}}}
 
 
Currently I am using Postman tool to do this.But soapUI would be excellent if it supports it.Not sure.
nmrao
Community Hero

Re: Hi Team,Can we test GraphQL request responses in SOAPUI ?

@udaysqa9, thank you for clarifying.

Yes, you can use SoapUI tool for your testing. It also allows users to automate the functional tests.


Regards,
Rao.
udaysqa9
New Contributor

Re: Hi Team,Can we test GraphQL request responses in SOAPUI ?

Hi Bro,

I am using SoapUI tool for testing soap and rest services from past 2 years.

My question is will SoapUi support the testing of GraphQL API in a similar way how we tested soap and rest ?

And if yes can you help me with it ?

PaulMS
Super Contributor

Re: Hi Team,Can we test GraphQL request responses in SOAPUI ?

A good place to start is the trial version of Ready API that has a plugin to convert Postman collections.

https://support.smartbear.com/readyapi/docs/testing/integrations/postman.html

https://stackoverflow.com/questions/36936635/how-to-import-postmans-collection-into-soapui

 

nmrao
Community Hero

Re: Hi Team,Can we test GraphQL request responses in SOAPUI ?

What application does not matter. The application which you mentioned seems to support REST and you know soapui supports it.

If you have any specific issue please feel free to post the issue details the forum. There are many community members who are willing to help the needy people.



Regards,
Rao.
laird
Regular Visitor

Re: Hi Team,Can we test GraphQL request responses in SOAPUI ?

GraphQL is not the same as REST, it is an alternative protocol, also based on HTTP. https://graphql.org explains it well. TL;DR: It's an HTTP POST of JSON, with a JSON response. Rather than being defined by swagger (or RAML) the way REST is, GraphQL's schema definition and validation are built into the GraphQL spec. Theoretically any HTTP testing tool that can do POST and accept a JSON response could be used to test GraphQL, but of course having the tools understand what they are doing would be more productive (e.g. a query builder is much faster and more accurate than hand coding queries, data driven testing beats manually coding each test call, etc.). And by that standard, there's no sign that SoapUI supports GraphQL at all.

That being said, given how easy it is to wrote GraphQL queries (e.g. with Apollo) and use an open source JavaScript testing library, SoapUI might be overkill.

tamnor
Occasional Contributor

Re: Hi Team,Can we test GraphQL request responses in SOAPUI ?

Hi, I am trying to find out how I can send a GraphQL request using SoapUI. I am able to do it in Postman but when I try it in SoapUI I get {"errors":[{"message":"Must provide query string."}]}. I have added the Content-Type header as application/graphql. I want to use SoapUI because Postman doesn't seem to support creating more automated test scripts with property transfers and assertions the way SoapUI does.

 

I am just wondering why you think using SoapUI would be overkill? You may well be right but just wondering why you think this. Where would you use the Open Source Javascript library you mention if you are a tester wanting to test this externally?

 

Thanks.

JHunt
Community Hero

Re: Hi Team,Can we test GraphQL request responses in SOAPUI ?

{"errors":[{"message":"Must provide query string."}]}

Sounds like you haven't set the request parameters correctly for the API you are calling.

Create parameters on your request with the type of QUERY. This will add to your request URI such as http://www.example.com/resource?blah=123.

 

No reason you can't test GraphQL with SoapUI.

New Here?
Join us and watch the welcome video:
Top Kudoed Authors