Introspection query without generated types

I’m trying to use a tool to visualize my GraphQL schema. The problem is that it comes with too much garbage. I wanted to filter out all the generated types from Dgraph and get only the types I define in my .graphql file.

For example, the Nova tool (GitHub - nova-introspection/Nova: GraphQL Schema Visualizer) runs this introspection query:

query IntrospectionQuery {
    __schema {
      types {
        ...FullType
      }
    }
  }
  fragment FullType on __Type {
    kind
    name
    description
    fields {
      name
      description
      type {
        ...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
                }
              }
            }
          }
        }
      }
    }
  }

I wanted to not get types ending with “AggregateResult” or “Payload”, for example.

Thanks in advance!

Hi @jrmatos,

Introspection queries don’t have any way to filter their output. If all you are looking for is the input schema that you supplied initially, then sending the following GraphQL query to /admin endpoint might be useful:

query {
  getGQLSchema {
    schema
  }
}

This would return the input GraphQL schema that you had initially supplied as a string.