Skip to content

Commit 33be606

Browse files
authored
Merge pull request #99 from barseghyanartur/master
Fix spelling mistakes, minor clean up
2 parents baed65b + 1b47210 commit 33be606

File tree

7 files changed

+9
-17
lines changed

7 files changed

+9
-17
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A [Mongoengine](https://mongoengine-odm.readthedocs.io/) integration for [Graphe
77

88
## Installation
99

10-
For instaling graphene-mongo, just run this command in your shell
10+
For installing graphene-mongo, just run this command in your shell
1111

1212
```
1313
pip install graphene-mongo

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A `Mongoengine <https://mongoengine-odm.readthedocs.io/>`__ integration for `Gra
1515
Installation
1616
------------
1717

18-
For instaling graphene-mongo, just run this command in your shell
18+
For installing graphene-mongo, just run this command in your shell
1919

2020
.. code:: bash
2121

docs/tutorial.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Let's get start with following models:
6464
Schema
6565
------
6666

67-
Here I assume you guys have the basic knowledage of how schema works in GraphQL, that I define the *root type* as the `Query` class below with the ability to list all employees.
67+
Here I assume you guys have the basic knowledge of how schema works in GraphQL, that I define the *root type* as the `Query` class below with the ability to list all employees.
6868

6969
.. code:: python
7070

examples/flask_mongoengine/app.py

-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,3 @@
4747
if __name__ == '__main__':
4848
init_db()
4949
app.run()
50-

examples/flask_mongoengine/schema.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from models import Role as RoleModel
77
from models import Task as TaskModel
88

9+
910
class Department(MongoengineObjectType):
1011

1112
class Meta:
@@ -26,6 +27,7 @@ class Meta:
2627
model = TaskModel
2728
interfaces = (Node,)
2829

30+
2931
class Employee(MongoengineObjectType):
3032

3133
class Meta:
@@ -39,5 +41,5 @@ class Query(graphene.ObjectType):
3941
all_roles = MongoengineConnectionField(Role)
4042
role = graphene.Field(Role)
4143

42-
schema = graphene.Schema(query=Query, types=[Department, Employee, Role])
4344

45+
schema = graphene.Schema(query=Query, types=[Department, Employee, Role])

graphene_mongo/tests/models.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Article(mongoengine.Document):
4545
help_text="The date of first press.")
4646
editor = mongoengine.ReferenceField(Editor)
4747
reporter = mongoengine.ReferenceField('Reporter')
48-
# Will not convert this field cause no chioces
48+
# Will not convert this field cause no choices
4949
generic_reference = mongoengine.GenericReferenceField()
5050

5151

@@ -69,14 +69,6 @@ class Reporter(mongoengine.Document):
6969
articles = mongoengine.ListField(mongoengine.ReferenceField(Article))
7070
embedded_articles = mongoengine.ListField(mongoengine.EmbeddedDocumentField(EmbeddedArticle))
7171
embedded_list_articles = mongoengine.EmbeddedDocumentListField(EmbeddedArticle)
72-
id = mongoengine.StringField(primary_key=True)
73-
first_name = mongoengine.StringField(required=True)
74-
last_name = mongoengine.StringField(required=True)
75-
email = mongoengine.EmailField()
76-
awards = mongoengine.ListField(mongoengine.StringField())
77-
articles = mongoengine.ListField(mongoengine.ReferenceField(Article))
78-
embedded_articles = mongoengine.ListField(mongoengine.EmbeddedDocumentField(EmbeddedArticle))
79-
embedded_list_articles = mongoengine.EmbeddedDocumentListField(EmbeddedArticle)
8072
generic_reference = mongoengine.GenericReferenceField(
8173
choices=[Article, Editor, ]
8274
)

graphene_mongo/types.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def construct_fields(model, registry, only_fields, exclude_fields):
2121
exclude_fields ([str]):
2222
2323
Returns:
24-
(OrderedDict, OrderedDict): coverted fields and self reference fields.
24+
(OrderedDict, OrderedDict): converted fields and self reference fields.
2525
2626
"""
2727
_model_fields = get_model_fields(model)
@@ -163,13 +163,12 @@ def rescan_fields(cls):
163163

164164
mongoengine_fields = yank_fields_from_attrs(converted_fields, _as=graphene.Field)
165165

166-
# The initial scan should take precidence
166+
# The initial scan should take precedence
167167
for field in mongoengine_fields:
168168
if field not in cls._meta.fields:
169169
cls._meta.fields.update({field: mongoengine_fields[field]})
170170
# Self-referenced fields can't change between scans!
171171

172-
173172
# noqa
174173
@classmethod
175174
def is_type_of(cls, root, info):

0 commit comments

Comments
 (0)