@redocly/graphql-docs
Version:
Redocly GraphQL docs
5 lines (4 loc) • 459 B
JavaScript
import{GraphQLList as i,GraphQLNonNull as a}from"graphql";import{indent as l}from"./indentation.js";function c(n,t){return n.length===0?"":t?o(n):u(n)}function u(n){return`(${n.map(r).join(", ")})`}function r(n){return`$${n.name}: ${e(n.type)}`}function e(n){return n instanceof i?`[${e(n.ofType)}]`:n instanceof a?`${e(n.ofType)}!`:n.name}function o(n){return`(
${n.map(m).join(`
`)}
)`}function m(n){return`${l(1)}${r(n)}`}export{c as getVariablesExample};