stellate
Version:
The CLI you need to work with Stellate from your CLI. See https://docs.stellate.co/docs/cli for the complete documentation.
2 lines (1 loc) • 464 B
JavaScript
function l(e){return e.operation==="query"}function y(e){return e.operation==="mutation"}function m(e,t){return e.rootFields.some(i=>i.name===t)}function p(e,{queryFields:t={},mutationFields:i={},...a}){let o="",n={};return l(e)?(o="Query",n=t):y(e)&&(o="Mutation",n=i),Object.entries(n).filter(([u])=>m(e,u)).map(([u,r])=>({...a,name:`${a.name} (${o}.${u})`,limit:{type:"RequestCount",...r}}))}export{p as byField,m as hasRootField,y as isMutation,l as isQuery};