API GraphQL & SOAP Testing 1 — Questions and Answers
Question 1: What is the primary HTTP method used to send GraphQL queries and mutations?
- GET
- PUT
- POST (Correct answer)
- DELETE
Correct answer: POST
GraphQL typically uses HTTP POST with a JSON body containing the query string, variables, and operation name.
Question 2: What is a GraphQL 'schema' used for?
- Defining API authentication rules
- Describing all available types, queries, mutations, and subscriptions in the API (Correct answer)
- Setting rate limits
- Configuring CORS policies
Correct answer: Describing all available types, queries, mutations, and subscriptions in the API
The GraphQL schema is the contract that defines every type, field, query, mutation, and subscription the API exposes.
Question 3: What is the difference between a GraphQL 'query' and a 'mutation'?
- Queries are faster; mutations are slower
- Queries read data; mutations create, update, or delete data (Correct answer)
- Queries use GET; mutations use POST
- Queries are public; mutations require authentication
Correct answer: Queries read data; mutations create, update, or delete data
In GraphQL, queries are read operations (analogous to REST GET) while mutations modify server-side data (analogous to REST POST/PUT/DELETE).
Question 4: What does SOAP stand for in web services testing?
- Simple Object Access Protocol (Correct answer)
- Secure Open API Protocol
- Standard Object Application Payload
- Structured Output API Protocol
Correct answer: Simple Object Access Protocol
SOAP (Simple Object Access Protocol) is an XML-based messaging protocol used for structured communication between web services.
Question 5: What format do SOAP API messages use for their payload?
- JSON
- CSV
- XML (Correct answer)
- YAML
Correct answer: XML
SOAP messages are always XML-formatted, wrapped in an Envelope element containing optional Header and mandatory Body elements.
Question 6: Which tool is commonly used for testing SOAP web services?
- Postman (limited)
- SoapUI (Correct answer)
- k6
- Newman
Correct answer: SoapUI
SoapUI is the industry-standard tool for testing SOAP web services, supporting WSDL import, assertion-based testing, and security scanning.
What is the primary HTTP method used to send GraphQL queries and mutations?