UNPKG

@redocly/graphql-docs

Version:

Redocly GraphQL docs

2 lines (1 loc) 889 B
import{jsx as a}from"react/jsx-runtime";import{TypeGroup as e}from"../../schema/index.js";import{DirectiveItem as i}from"./DirectiveItem.js";import{EnumItem as s}from"./EnumItem.js";import{FieldsTypeItem as n}from"./FieldsTypeItem.js";import{MutationItem as p}from"./MutationItem.js";import{QueryItem as c}from"./QueryItem.js";import{ScalarItem as u}from"./ScalarItem.js";import{SubscriptionItem as f}from"./SubscriptionItem.js";import{UnionItem as b}from"./UnionItem.js";function Q({name:o,type:t,path:m}){let r;switch(t){case e.queries:r=c;break;case e.mutations:r=p;break;case e.subscriptions:r=f;break;case e.directives:r=i;break;case e.objects:case e.interfaces:case e.inputs:r=n;break;case e.unions:r=b;break;case e.enums:r=s;break;case e.scalars:r=u;break;default:throw new Error(`Unknown or unhandled GraphQL item type: ${t}`)}return a(r,{name:o,path:m})}export{Q as GraphQlItem};