UNPKG

@redocly/graphql-docs

Version:

Redocly GraphQL docs

4 lines (3 loc) 672 B
import{getTypeExample as i}from"../type/index.js";import{getFieldExample as m}from"./field-example.js";import{getVariablesExample as l}from"./variables-example.js";function s({operationType:t,operation:e,expandLevel:a,multilineArguments:n,translate:r}){const p=l(e.args,n),o=m({field:e,multilineArguments:n,indentation:1,translate:r,maxLevel:a});return`${t} ${e.name}${p} { ${o} }`}function E({responseType:t,expandLevel:e}){return{data:i({type:t,expandLevel:e})}}function g({args:t,expandLevel:e}){return t.reduce((a,n)=>(a[n.name]=i({type:n.type,expandLevel:e}),a),{})}export{s as getOperationExample,E as getOperationResponseExample,g as getOperationVariablesExample};