gql-string-to-object
Version:
Helper function to convert GQL strings to objects!
9 lines (8 loc) • 642 B
TypeScript
/** Will convert a GraphQL schema into an key-value object
* @params {schema} schema - GraphQL schema object
* @params {string} targetType - [optional] return a specific type / interface rather than the whole schema
* @params {boolean} hideTypes - [optional, default = false] return {} as value instead of "String", "Int", "ENUM", etc...
* @params {boolean} minimizeEnum - [optional, default = true] whether ENUMs should be listed out or return "ENUM" instead
*/
declare const schemaToObject: (schema: Schema, targetType?: string | undefined, hideTypes?: boolean, minimizeEnum?: boolean) => ReturnObject;
export default schemaToObject;