GraphQL
Last updated
Was this helpful?
Last updated
Was this helpful?
is an API query language that is designed to facilitate efficient communication between clients and servers. It enables the user to specify exactly what data they want in the response, helping to avoid the large response objects and multiple calls that can sometimes be seen with REST APIs.
/graphql
/api
/api/graphql
/graphql/api
/graphql/graphql
Also try appending /v1
to the path
GraphQL services will often respond to any non-GraphQL request with a "query not present" or similar error.
In general GraphQl only accept POST requests that have a content-type of application/json
. However, some endpoints may accept alternative methods. Try with
POST requests that use a content-type of x-www-form-urlencoded
.
With PurpSuite:
Right-click in Repeter and GraphQL > Set introspection query
Right-click in Repeter and GraphQL > Set legacy introspection query
Right-click in Response and GraphQL > Save GraphQL queries to site map
Introspection is a built-in GraphQL function that enables you to query a server for information about the schema. Introspection helps you to understand how you can interact with a GraphQL API. It can also disclose potentially sensitive data, such as description fields. It is best practice for introspection to be disabled in production environments, but this advice is not always followed.
When developers disable introspection, they could use a regex to exclude the __schema
keyword in queries. You should try characters like spaces, new lines and commas, as they are ignored by GraphQL but not by flawed regex.
ex. Regex exclude: __schema{
Bypass: __schema\n{
You can get as much information on the underlying schema as possible. The example query below returns full details on all queries, mutations, subscriptions, types, and fragments.
You can sometimes use suggestions to glean information on an API's structure.
Suggestions are a feature of the Apollo GraphQL platform: ex. There is no entry for 'productInfo'. Did you mean 'productInformation' instead?
Tool that uses suggestions to automatically recover all or part of a GraphQL schema, even when introspection is disabled.
Send some test requests to understand more about how it works.
Brute Force with Alias
using alternative HTTP methods.
Use can also use for a better view of the scheme.