📪Introspection schema

The primary purpose of introspection is to enable tools, clients, and developers to discover the available types, queries, mutations, and their relationships in the GraphQL schema.

introspection schema:

query IntrospectionQuery {
    __schema {
      queryType { name }
      mutationType { name }
      types {
        ...FullType
      }
      directives {
        name
        description
        locations
        args {
          ...InputValue
        }
      }
    }
  }
  fragment FullType on __Type {
    kind
    name
    description
    fields(includeDeprecated: true) {
      name
      description
      args {
        ...InputValue
      }
      type {
        ...TypeRef
      }
      isDeprecated
      deprecationReason
    }
    inputFields {
      ...InputValue
    }
    interfaces {
      ...TypeRef
    }
    enumValues(includeDeprecated: true) {
      name
      description
      isDeprecated
      deprecationReason
    }
    possibleTypes {
      ...TypeRef
    }
  }
  fragment InputValue on __InputValue {
    name
    description
    type { ...TypeRef }
    defaultValue
  }
  fragment TypeRef on __Type {
    kind
    name
    ofType {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
              ofType {
                kind
                name
                ofType {
                  kind
                  name
                }
              }
            }
          }
        }
      }
    }
  }

website to play with graphql api :

countries graphql api
rick and morty graphql api

😄 Graphql Voyager

It helps in displaying the output of an introspection query in a visualized manner

graphql voyager
graphql voager

🎉 Clairvoyance

If introspection query is disabled on an API, then the GraphQL schema can be fetched using the Clairvoyance tool.

clairvoyance
all about graphql vulns

🎉 Suggestions

Suggestions are crucial in GraphQL because they enable the prediction of GraphQL fields. when introspection is disable using this suggestion a query can be built or directly clairvoyance can be used.

like this:

suggestion

😄 Others

For listing names of schema

{__schema{types{name}}}

For listing field names

{__schema{queryType{fields{name}}}}

Last updated