4

I am learning GraphiQl now and try to list all available queries that I can make. I run this:

{
  __schema {
    types {
      name
    }
  }
}

and eventually get some schema types, but not all of them. If I look up docs that are on the right side ("Documentation explorer") I can see root types query: Query that lists more queries like user and users (these were not shown on my introspection queries). There are few screenshots: ss1 ss2[![ss3]3

Question: how could I view these lowerCase methods like allUsers from query? For example, I won't have access to docs and will have only introspection query.

Thanks!

1 Answer 1

5

With the query that you're using as shown, it would only give you the Types of objects. You can get all the queries of Query type with the below:

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

For example, running the above on GitHub's GraphQL responds with the below:

{
  "data": {
    "__schema": {
      "queryType": {
        "name": "Query",
        "fields": [
          {
            "name": "codeOfConduct"
          },
          {
            "name": "codesOfConduct"
          },
          {
            "name": "enterprise"
          },
          {
            "name": "enterpriseAdministratorInvitation"
          },
          {
            "name": "enterpriseAdministratorInvitationByToken"
          },
          {
            "name": "license"
          },
          {
            "name": "licenses"
          },
          {
            "name": "marketplaceCategories"
          },
          {
            "name": "marketplaceCategory"
          },
          {
            "name": "marketplaceListing"
          },
          {
            "name": "marketplaceListings"
          },
          {
            "name": "meta"
          },
          {
            "name": "node"
          },
          {
            "name": "nodes"
          },
          {
            "name": "organization"
          },
          {
            "name": "rateLimit"
          },
          {
            "name": "relay"
          },
          {
            "name": "repository"
          },
          {
            "name": "repositoryOwner"
          },
          {
            "name": "resource"
          },
          {
            "name": "search"
          },
          {
            "name": "securityAdvisories"
          },
          {
            "name": "securityAdvisory"
          },
          {
            "name": "securityVulnerabilities"
          },
          {
            "name": "topic"
          },
          {
            "name": "user"
          },
          {
            "name": "viewer"
          }
        ]
      }
    }
  }
}

You can search for the remaining fields within fields that you might need to add to your query by searching for __Field in the Documentation Explorer of GraphiQL.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.