Let's say i have a GraphQL Schema like:
type author {
id: Int
name: String
rating: Int
}
You can use this type definition to generate an executable schema that can be queried on.
But in case i don't have the above type definitions, but only have GraphQLSchema object obtained through the introspection query, how do i generate the above type definitions?
I checked out graphql/utilities which had a printSchema
method, that accepts a GraphQLSchema object and prints a string. But i can't seem to filter the output for a particular node alone, since i don't want the entire schema. Parsing the string output is not desirable.
Pointing to right methods is appreciated.