Return a dict from field name to GraphQL field type, for the specified graph class.
491362
def _get_fields_for_class(schema_graph, graphql_types, field_type_overrides, hidden_classes,
                          cls_name):
    """"""
    properties = schema_graph.get_element_by_class_name(cls_name).properties

    # Add leaf GraphQL fields (class properties).
    all_properties = {
        property_name: _property_descriptor_to_graphql_type(property_obj)
        for property_name, property_obj in six.iteritems(properties)
    }
    result = {
        property_name: graphql_representation
        for property_name, graphql_representation in six.iteritems(all_properties)
        if graphql_representation is not None
    }

    # Add edge GraphQL fields (edges to other vertex classes).
    schema_element = schema_graph.get_element_by_class_name(cls_name)
    outbound_edges = (
        ('out_{}'.format(out_edge_name),
         schema_graph.get_element_by_class_name(out_edge_name).properties[
             EDGE_DESTINATION_PROPERTY_NAME].qualifier)
        for out_edge_name in schema_element.out_connections
    )
    inbound_edges = (
        ('in_{}'.format(in_edge_name),
         schema_graph.get_element_by_class_name(in_edge_name).properties[
             EDGE_SOURCE_PROPERTY_NAME].qualifier)
        for in_edge_name in schema_element.in_connections
    )
    for field_name, to_type_name in chain(outbound_edges, inbound_edges):
        edge_endpoint_type_name = None
        subclasses = schema_graph.get_subclass_set(to_type_name)

        to_type_abstract = schema_graph.get_element_by_class_name(to_type_name).abstract
        if not to_type_abstract and len(subclasses) > 1:
            # If the edge endpoint type has no subclasses, it can't be coerced into any other type.
            # If the edge endpoint type is abstract (an interface type), we can already
            # coerce it to the proper type with a GraphQL fragment. However, if the endpoint type
            # is non-abstract and has subclasses, we need to return its subclasses as an union type.
            # This is because GraphQL fragments cannot be applied on concrete types, and
            # GraphQL does not support inheritance of concrete types.
            type_names_to_union = [
                subclass
                for subclass in subclasses
                if subclass not in hidden_classes
            ]
            if type_names_to_union:
                edge_endpoint_type_name = _get_union_type_name(type_names_to_union)
        else:
            if to_type_name not in hidden_classes:
                edge_endpoint_type_name = to_type_name

        if edge_endpoint_type_name is not None:
            # If we decided to not hide this edge due to its endpoint type being non-representable,
            # represent the edge field as the GraphQL type List(edge_endpoint_type_name).
            result[field_name] = GraphQLList(graphql_types[edge_endpoint_type_name])

    for field_name, field_type in six.iteritems(field_type_overrides):
        if field_name not in result:
            raise AssertionError(u'Attempting to override field "{}" from class "{}", but the '
                                 u'class does not contain said field'.format(field_name, cls_name))
        else:
            result[field_name] = field_type

    return result
64632
function getFieldDefinitionStrict(
  schema: GraphQLSchema,
  parentType: GraphQLOutputType,
  fieldName: string,
  fieldAST: FieldNode,
): ?GraphQLField<mixed, mixed> {
  const type = getRawType(parentType);
  const isQueryType = type === schema.getQueryType();
  const hasTypeName =
    type instanceof GraphQLObjectType ||
    type instanceof GraphQLInterfaceType ||
    type instanceof GraphQLUnionType;

  let schemaFieldDef;
  if (isQueryType && fieldName === SchemaMetaFieldDef.name) {
    schemaFieldDef = SchemaMetaFieldDef;
  } else if (isQueryType && fieldName === TypeMetaFieldDef.name) {
    schemaFieldDef = TypeMetaFieldDef;
  } else if (hasTypeName && fieldName === TypeNameMetaFieldDef.name) {
    schemaFieldDef = TypeNameMetaFieldDef;
  } else if (
    type instanceof GraphQLInterfaceType ||
    type instanceof GraphQLObjectType
  ) {
    schemaFieldDef = type.getFields()[fieldName];
  }
  return schemaFieldDef;
}
746386
def from_json(graph_json_dict: Mapping[str, Any], check_version=True) -> BELGraph:
    """"""
    graph = node_link_graph(graph_json_dict)
    return ensure_version(graph, check_version=check_version)
642799
def get_field_type(info):
    """"""

    type_ = info.get_type()

    cls = get_field_class(type_)

    field = cls(info, type_, None)
    field.setup()
    return field.py_type
670574
function getTypeInfo (obj, info) {
  const constructorName = _.constructorName(obj)
  const _info = info || {
    type: null,
    name: null,
    isList: false,
    isNonNull: false
  }

  switch (constructorName) {
    case 'GraphQLNonNull':
      _info.isNonNull = true
      return getTypeInfo(obj.ofType, _info)
    case 'GraphQLList':
      _info.isList = true
      return getTypeInfo(obj.ofType, _info)
    default:
      _info.type = obj
      _info.name = obj.name
  }
  return _info
}
337181
def is_vertex_field_type(graphql_type):
    """"""
    # This will need to change if we ever support complex embedded types or edge field types.
    underlying_type = strip_non_null_from_type(graphql_type)
    return isinstance(underlying_type, (GraphQLInterfaceType, GraphQLObjectType, GraphQLUnionType))
1187679
def field_function(self, type_code, func_name):
        """"""
        assert func_name in ('to_json', 'from_json')
        name = "field_%s_%s" % (type_code.lower(), func_name)
        return getattr(self, name)
374393
def getConfig(self):
        
        return {'graph': self._graphAttrDict,
                'fields': [(field_name, self._fieldAttrDict.get(field_name))
                           for field_name in self._fieldNameList]}
653669
def graphql_impl(
    schema,
    source,
    root_value,
    context_value,
    variable_values,
    operation_name,
    field_resolver,
    type_resolver,
    middleware,
    execution_context_class,
) -> AwaitableOrValue[ExecutionResult]:
    """"""
    # Validate Schema
    schema_validation_errors = validate_schema(schema)
    if schema_validation_errors:
        return ExecutionResult(data=None, errors=schema_validation_errors)

    # Parse
    try:
        document = parse(source)
    except GraphQLError as error:
        return ExecutionResult(data=None, errors=[error])
    except Exception as error:
        error = GraphQLError(str(error), original_error=error)
        return ExecutionResult(data=None, errors=[error])

    # Validate
    from .validation import validate

    validation_errors = validate(schema, document)
    if validation_errors:
        return ExecutionResult(data=None, errors=validation_errors)

    # Execute
    return execute(
        schema,
        document,
        root_value,
        context_value,
        variable_values,
        operation_name,
        field_resolver,
        type_resolver,
        middleware,
        execution_context_class,
    )
163241
def make_dict(self, field_values):
        ''' 
        '''
        data_dict = {}
        for key, value, field_type, converter in zip(self.field_names, field_values, self.field_types, self.type_converters):
            try:
                # We have to deal with the '-' based on the field_type
                data_dict[key] = self.dash_mapper.get(field_type, '-') if value == '-' else converter(value)
            except ValueError as exc:
                print('Conversion Issue for key:{:s} value:{:s}\n{:s}'.format(key, str(value), str(exc)))
                data_dict[key] = value
                if self._strict:
                    raise exc

        return data_dict
473361
def _node_to_dict(cls, node, json, json_fields):
        
        if json:
            pk_name = node.get_pk_name()
            # jqTree or jsTree format
            result = {'id': getattr(node, pk_name), 'label': node.__repr__()}
            if json_fields:
                result.update(json_fields(node))
        else:
            result = {'node': node}
        return result
1289497
function getFieldDefinitionLegacy(
  schema: GraphQLSchema,
  parentType: GraphQLOutputType,
  fieldName: string,
  fieldAST: FieldNode,
): ?GraphQLField<mixed, mixed> {
  let schemaFieldDef = getFieldDefinitionStrict(
    schema,
    parentType,
    fieldName,
    fieldAST,
  );
  if (!schemaFieldDef) {
    const type = getRawType(parentType);
    schemaFieldDef = getFieldDefinitionLegacyImpl(
      schema,
      type,
      fieldName,
      fieldAST,
    );
  }
  return schemaFieldDef || null;
}
476352
def connection_field_ast(field)
      f_ast = field_ast(field, connection_arguments)
      return nil if f_ast.nil?
      edges_fields = [edges_field_ast(field.type.unwrap.get_field('edges'))]
      if f_ast.respond_to?(:merge) # GraphQL-Ruby 1.9+
        f_ast.merge(selections: f_ast.selections + edges_fields)
      else
        f_ast.selections.concat(edges_fields)
        f_ast
      end
    end
57433
def _dictify(field, value):
    
    if value is None:
        return None
    elif field.type_:
        return value.to_dict()
    return field.dict_value(value)
61146
def field_to_dict(self, field):
        """"""
        value = getattr(self, field)
        if isinstance(value, (list, tuple)):
            return [self.value_to_dict(val) for val in value]
        return self.value_to_dict(value)
828526
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'field_name') and self.field_name is not None:
            _dict['field'] = self.field_name
        if hasattr(self, 'field_type') and self.field_type is not None:
            _dict['type'] = self.field_type
        return _dict
784415
def get_dict_for_field(self, field_name):
        
        try:
            field = self.model._meta.get_field(field_name)
        except FieldDoesNotExist:
            field = None
        return {
            'label': self.get_field_label(field_name, field),
            'value': self.get_field_display_value(field_name, field),
        }