Sha256: f8d13100f470d47b54dd440e09722bc81771a0da822213f024f2cb16d2939c3d
Contents?: true
Size: 576 Bytes
Versions: 26
Compression:
Stored size: 576 Bytes
Contents
import { Kind } from '../language/kinds.mjs'; import { GraphQLList, GraphQLNonNull } from '../type/definition.mjs'; export function typeFromAST(schema, typeNode) { switch (typeNode.kind) { case Kind.LIST_TYPE: { const innerType = typeFromAST(schema, typeNode.type); return innerType && new GraphQLList(innerType); } case Kind.NON_NULL_TYPE: { const innerType = typeFromAST(schema, typeNode.type); return innerType && new GraphQLNonNull(innerType); } case Kind.NAMED_TYPE: return schema.getType(typeNode.name.value); } }
Version data entries
26 entries across 26 versions & 1 rubygems