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

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.25 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.24 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.23 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.22 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.21 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.20 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.19 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.18 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.17 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.16 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.15 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.14 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.13 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.12 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.11 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.10 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.9 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.8 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs
clapton-0.0.7 lib/clapton/javascripts/node_modules/graphql/utilities/typeFromAST.mjs