graphql-python / graphql-python/graphene-mongo

Private fields and `db_field` arg’

Open
#153 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
287
Forks
111
PR merge metrics
No merged PRs in 30d

Description

Hello,

I’m playing with private fields with MongoEngine and Graphene-Mongo like this:
```python
class MyDocument(Document):
# define a “private” field (with underscore)
# but set the database field without the underscore:
_private = StringField(db_field="private")

class MyType(MongoengineObjectType):
class Meta:
model = MyDocument
```

And… the generated `MyType` has a field named `Private` (not `private`).

That make me ask 2 questions:
* It seems the conversion snake_case to camelCase does not make any special case for leading underscore: is it normal?
* Why not consider the database field?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.