graphene_elastic package

Subpackages

Submodules

graphene_elastic.advanced_types module

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

Bases: 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: _CoordinatesTypeField

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

Bases: _CoordinatesTypeField

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

Bases: _CoordinatesTypeField

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

graphene_elastic.arrayconnection module

graphene_elastic.arrayconnection.connection_from_list_slice(list_slice, args=None, connection_type=None, edge_type=None, pageinfo_type=None, slice_start=0, list_length=0, list_slice_length=None, connection_field=None)[source]

Given a slice (subset) of an array, returns a connection object for use in GraphQL. This function is similar to connectionFromArray, but is intended for use cases where you know the cardinality of the connection, consider it too large to materialize the entire array, and instead wish pass in a slice of the total result large enough to cover the range specified in args.

graphene_elastic.compat module

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_elasticsearch_field(field: Keyword, registry=None)
graphene_elastic.converter.convert_elasticsearch_field(field: Text, registry=None)
graphene_elastic.converter.convert_elasticsearch_field(field: Short, registry=None)
graphene_elastic.converter.convert_elasticsearch_field(field: Long, registry=None)
graphene_elastic.converter.convert_elasticsearch_field(field: Integer, registry=None)
graphene_elastic.converter.convert_elasticsearch_field(field: Byte, registry=None)
graphene_elastic.converter.convert_elasticsearch_field(field: Boolean, registry=None)
graphene_elastic.converter.convert_elasticsearch_field(field: ScaledFloat, registry=None)
graphene_elastic.converter.convert_elasticsearch_field(field: Float, registry=None)
graphene_elastic.converter.convert_elasticsearch_field(field: HalfFloat, registry=None)
graphene_elastic.converter.convert_elasticsearch_field(field: Double, registry=None)
graphene_elastic.converter.convert_elasticsearch_field(field: Date, registry=None)
graphene_elastic.converter.convert_elasticsearch_field(field: Nested, registry=None)
graphene_elastic.converter.convert_elasticsearch_field(field: Object, registry=None)
graphene_elastic.converter.convert_field_to_boolean(field, registry=None)[source]
graphene_elastic.converter.convert_field_to_complex_object(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.converter.singledispatch(func)[source]

Single-dispatch generic function decorator.

Transforms a function into a generic function, which can have different behaviours depending upon the type of its first argument. The decorated function acts as the default implementation, and additional implementations can be registered using the register() attribute of the generic function.

graphene_elastic.enums module

class graphene_elastic.enums.NoValue(value)[source]

Bases: 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: IterableConnectionField

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

graphene_elastic.logging module

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]

graphene_elastic.versions module

Contains information about the current Elasticsearch version in use, including (LTE and GTE).

graphene_elastic.versions.get_elasticsearch_version(default=(2, 0, 0))[source]

Get Elasticsearch version.

Parameters:

default (tuple) – Default value. Mainly added for building the docs when Elasticsearch is not running.

Returns:

Return type:

list

Module contents

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

Bases: IterableConnectionField

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

Bases: ObjectType

classmethod get_node(info, id)[source]
property 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]