graphene_elastic package

Submodules

graphene_elastic.advanced_types module

class graphene_elastic.advanced_types.FileFieldType(*args, **kwargs)[source]

Bases: graphene.types.objecttype.ObjectType

chunk_size = <graphene.types.scalars.Int object>
content_type = <graphene.types.scalars.String object>
data = <graphene.types.scalars.String object>
length = <graphene.types.scalars.Int object>
md5 = <graphene.types.scalars.String object>
resolve_chunk_size(info)[source]
resolve_content_type(info)[source]
resolve_data(info)[source]
resolve_length(info)[source]
resolve_md5(info)[source]
class graphene_elastic.advanced_types.MultiPolygonFieldType(*args, **kwargs)[source]

Bases: graphene_elastic.advanced_types._CoordinatesTypeField

coordinates = <graphene.types.structures.List object>
class graphene_elastic.advanced_types.PointFieldType(*args, **kwargs)[source]

Bases: graphene_elastic.advanced_types._CoordinatesTypeField

coordinates = <graphene.types.structures.List object>
class graphene_elastic.advanced_types.PolygonFieldType(*args, **kwargs)[source]

Bases: graphene_elastic.advanced_types._CoordinatesTypeField

coordinates = <graphene.types.structures.List object>

graphene_elastic.constants module

Constants module. Contains Elasticsearch constants, lookup constants, functional constants, suggesters, etc.

graphene_elastic.converter module

exception graphene_elastic.converter.ElasticsearchConversionError[source]

Bases: Exception

graphene_elastic.converter.convert_elasticsearch_field(field, registry=None)[source]
graphene_elastic.converter.convert_field_to_boolean(field, registry=None)[source]
graphene_elastic.converter.convert_field_to_datetime(field, registry=None)[source]
graphene_elastic.converter.convert_field_to_float(field, registry=None)[source]
graphene_elastic.converter.convert_field_to_int(field, registry=None)[source]
graphene_elastic.converter.convert_field_to_jsonstring(field, registry=None)[source]
graphene_elastic.converter.convert_field_to_string(field, registry=None)[source]

graphene_elastic.enums module

class graphene_elastic.enums.NoValue[source]

Bases: enum.Enum

String values in enum.

Example:

>>> class Color(NoValue):
>>>     RED = 'stop'
>>>     GREEN = 'go'
>>>     BLUE = 'too fast!'

Graphene example:

>>> @graphene.Enum.from_enum
>>> class ColorOptions(NoValue):
>>>
>>>     RED = 'stop'
>>>     GREEN = 'go'
>>>     BLUE = 'too fast!'
graphene_elastic.enums.convert_list_to_enum(values, enum_name='DynamicEnum', upper=True)[source]

Prepare list values for creating an Enum.

Example:

>>> values = ['red', 'green', 'blue']
>>> print(prepare_list_for_enum(values))
{'RED': 'red', 'GREEN': 'green', 'BLUE': 'blue'}

graphene_elastic.fields module

class graphene_elastic.fields.ElasticsearchConnectionField(type, *args, **kwargs)[source]

Bases: graphene.relay.connection.IterableConnectionField

args
chained_resolver(resolver, is_partial, root, info, **args)[source]
classmethod connection_resolver(resolver, connection_type, root, info, connection_field=None, **args)[source]
default_filter_backends
default_resolver(_root, info, **args)[source]
doc_type
document
field_args
fields
filter_backends
get_queryset(document, info, **args)[source]
get_resolver(parent_resolver)[source]
node_type
reference_args
registry
classmethod resolve_connection(connection_type, args, resolved, connection_field=None)[source]
type

graphene_elastic.helpers module

graphene_elastic.helpers.to_camel_case(snake_str: str) → str[source]

Convert snake_case to camelCase.

Capitalize the first letter of each part except the first one with the capitalize method and join all the parts together.

Adapted from this response in StackOverflow http://stackoverflow.com/a/19053800/1072990

Parameters:snake_str
Returns:
graphene_elastic.helpers.to_pascal_case(snake_str: str) → str[source]

Convert snake_case to CapWords.

Parameters:snake_str
Returns:

graphene_elastic.registry module

class graphene_elastic.registry.Registry[source]

Bases: object

get_converted_field(field)[source]
get_type_for_document(document)[source]
register(cls)[source]
register_converted_field(field, converted)[source]
graphene_elastic.registry.get_global_registry()[source]
graphene_elastic.registry.reset_global_registry()[source]

graphene_elastic.settings module

graphene_elastic.utils module

graphene_elastic.utils.get_document_fields(document, excluding=None)[source]
graphene_elastic.utils.get_field_description(field, registry=None)[source]

Common metadata includes verbose_name and help_text.

http://docs.mongoengine.org/apireference.html#fields

graphene_elastic.utils.get_node_from_global_id(node, info, global_id)[source]
graphene_elastic.utils.get_type_for_document(schema, document)[source]
graphene_elastic.utils.import_single_dispatch()[source]
graphene_elastic.utils.is_valid_elasticsearch_document(document)[source]

Module contents

class graphene_elastic.ElasticsearchConnectionField(type, *args, **kwargs)[source]

Bases: graphene.relay.connection.IterableConnectionField

args
chained_resolver(resolver, is_partial, root, info, **args)[source]
classmethod connection_resolver(resolver, connection_type, root, info, connection_field=None, **args)[source]
default_filter_backends
default_resolver(_root, info, **args)[source]
doc_type
document
field_args
fields
filter_backends
get_queryset(document, info, **args)[source]
get_resolver(parent_resolver)[source]
node_type
reference_args
registry
classmethod resolve_connection(connection_type, args, resolved, connection_field=None)[source]
type
class graphene_elastic.ElasticsearchObjectType(*args, **kwargs)[source]

Bases: graphene.types.objecttype.ObjectType

classmethod get_node(info, id)[source]
id
classmethod is_type_of(root, info)[source]
classmethod rescan_fields()[source]

Attempts to rescan fields and will insert any not converted initially.

resolve_id(info)[source]