UNPKG

@cran/gql.reflect

Version:

Cranberry Introspection Utilities for GraphQL

28 lines (27 loc) 1.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getIntrospectionQuery = void 0; function getIntrospectionQuery({ default: defaultFields = [], type = [], field = [], inputField = [], enumValue = [], } = {}) { /* eslint-disable indent */ return ([ "{__schema{types{", ["kind", "name", "description", ...defaultFields, ...type || [],], [" inputFields{...InputValue}", "interfaces{...TypeRef}", "possibleTypes{...TypeRef}",], "fields(includeDeprecated:true){", ["name", "description", "isDeprecated", "deprecationReason", ...defaultFields, ...field,], [" args{...InputValue}", "type{...TypeRef}",], "}", "enumValues(includeDeprecated:true){", ["name", "description", "isDeprecated", "deprecationReason", ...defaultFields, ...enumValue,], "}", "}}}", "fragment InputValue on __InputValue{", ["name", "description", "defaultValue", ...defaultFields, ...inputField,], " type{...TypeRef}", "}", "fragment TypeRef on __Type{", "kind,name,ofType{kind,name,ofType{kind,name,ofType{kind,name}}}", "}", ]).join(""); } exports.getIntrospectionQuery = getIntrospectionQuery;