I am trying to get an object representation of our graph without writing something custom to parse the output of the introspectionQuery
.
Ideally this would be a JSON object that had keys of the type name and their type as the value in the shape of the results of a query.
I have been playing around with the graphql/utilities
but don't find a way to do this one thing.
Any ideas on this?
Something like this:
import { graphql } from 'graphql';
import { introspectionQuery } from 'graphql/utilities';
import schema from '../schema';
export default async function(req, res) {
const result = await graphql(schema, introspectionQuery, {}, {}, {});
return res.json(result);
}
Outputs the schema, but it's not good as a visual representation of our data.
Found my answer here: https://github.com/APIs-guru/graphql-voyager