### Query __type Source: https://developers.switchy.io/docs/overview/schema-introspection Use the `__type` query to get specific details about a single type within the schema by providing its name. ```APIDOC ## Query __type ### Description Use the `__type` query to get details about any specific type in the schema by its name. ### Method POST ### Endpoint /graphql ### Parameters #### Request Body - **query** (string) - Required - The GraphQL query string. ### Request Example ```json { "query": "query { __type(name: \"links\") { name kind description fields { name } } }" } ``` ### Response #### Success Response (200) - **data** (object) - The result of the GraphQL query. - **__type** (object) - **name** (string) - **kind** (string) - **description** (string) - **fields** (array of objects) - **name** (string) #### Response Example ```json { "data": { "__type": { "name": "links", "kind": "OBJECT", "description": "Represents a link resource.", "fields": [ { "name": "id" }, { "name": "url" }, { "name": "title" } ] } } } ``` ``` -------------------------------- ### Query __schema Source: https://developers.switchy.io/docs/overview/schema-introspection Use the `__schema` query to list all types defined in the schema and retrieve details about each type, including its name, kind, description, and fields. ```APIDOC ## Query __schema ### Description Use the `__schema` query to list all types defined in the schema and get details about each. ### Method POST ### Endpoint /graphql ### Parameters #### Request Body - **query** (string) - Required - The GraphQL query string. ### Request Example ```json { "query": "query { __schema { types { name kind description fields { name } } } }" } ``` ### Response #### Success Response (200) - **data** (object) - The result of the GraphQL query. - **__schema** (object) - **types** (array of objects) - **name** (string) - **kind** (string) - **description** (string) - **fields** (array of objects) - **name** (string) #### Response Example ```json { "data": { "__schema": { "types": [ { "name": "__Schema", "kind": "OBJECT", "description": "A GraphQL schema is a collection of types, operations, and directives.", "fields": [ { "name": "queryType" }, { "name": "mutationType" }, { "name": "subscriptionType" }, { "name": "types" }, { "name": "directives" } ] } ] } } } ``` ``` -------------------------------- ### Query All Types in GraphQL Schema Source: https://developers.switchy.io/docs/overview/schema-introspection Use this query to list all types defined in the schema and retrieve details about each, including their names, kinds, descriptions, and fields. ```graphql query { __schema { types { name kind description fields { name } } } } ``` -------------------------------- ### Query Specific Type Details in GraphQL Source: https://developers.switchy.io/docs/overview/schema-introspection Query for details about a specific type by providing its name. This is useful for understanding the structure of a particular type within the schema. ```graphql query { __type(name: "links") { name kind description fields { name } } } ``` -------------------------------- ### Query GraphQL using cURL Source: https://developers.switchy.io/docs/overview/root-endpoint Use this cURL command to make a POST request to a GraphQL endpoint. Ensure the 'query' string is properly escaped with newline characters and inner double quotes. ```bash curl -H "Api-Authorization: your-token" -X POST -d " \ { \ \"query\": \"query { workspaces { companyName createdDate id name }}\" \ } \ " https://graphql.switchy.io/v1/graphql ``` -------------------------------- ### Full Introspection Query Source: https://developers.switchy.io/docs/overview/schema-introspection Perform a full introspection request of the schema to retrieve comprehensive details about the schema, including query, mutation, and subscription types, all defined types, directives, and their arguments. ```APIDOC ## Full Introspection Query ### Description Run a full introspection request of the schema to get comprehensive details about the schema, including query, mutation, and subscription types, all defined types, directives, and their arguments. ### Method POST ### Endpoint /graphql ### Parameters #### Request Body - **query** (string) - Required - The GraphQL query string containing the `IntrospectionQuery`. ### Request Example ```json { "query": "query IntrospectionQuery { __schema { queryType { name } mutationType { name } subscriptionType { 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 } } } } } } } }" } ``` ### Response #### Success Response (200) - **data** (object) - The result of the GraphQL query. - **__schema** (object) - Contains detailed information about the schema. - **queryType** (object) - **mutationType** (object) - **subscriptionType** (object) - **types** (array of objects) - Detailed information about each type in the schema. - **directives** (array of objects) - Detailed information about each directive. #### Response Example ```json { "data": { "__schema": { "queryType": { "name": "Query" }, "mutationType": { "name": "Mutation" }, "subscriptionType": null, "types": [ { "kind": "OBJECT", "name": "Query", "description": "Root query type.", "fields": [ { "name": "links", "description": "Retrieve a list of links.", "args": [], "type": { "kind": "LIST", "name": null, "ofType": { "kind": "OBJECT", "name": "Link", "ofType": null } }, "isDeprecated": false, "deprecationReason": null } ], "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null }, { "kind": "OBJECT", "name": "Link", "description": "Represents a link resource.", "fields": [ { "name": "id", "description": "The unique identifier for the link.", "args": [], "type": { "kind": "SCALAR", "name": "ID", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { "name": "url", "description": "The URL of the link.", "args": [], "type": { "kind": "SCALAR", "name": "String", "ofType": null }, "isDeprecated": false, "deprecationReason": null }, { "name": "title", "description": "The title of the link.", "args": [], "type": { "kind": "SCALAR", "name": "String", "ofType": null }, "isDeprecated": false, "deprecationReason": null } ], "inputFields": null, "interfaces": null, "enumValues": null, "possibleTypes": null } ], "directives": [] } } } ``` ``` -------------------------------- ### Full GraphQL Schema Introspection Query Source: https://developers.switchy.io/docs/overview/schema-introspection Perform a comprehensive introspection of the entire GraphQL schema. This query retrieves detailed information about query types, mutation types, subscription types, all types, and directives. ```graphql query IntrospectionQuery { __schema { queryType { name } mutationType { name } subscriptionType { 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 } } } } } } } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.