Skip to content

Commit c3c2eed

Browse files
authored
Merge pull request #81 from conao3/fix-doc
Fix readme
2 parents 2fd67a8 + 4f1cbe4 commit c3c2eed

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class Person(PydanticObjectType):
120120
model = PersonModel
121121
# exclude specified fields
122122
exclude_fields = ("id",)
123-
123+
124124
full_name = graphene.String()
125125

126126
def resolve_full_name(self, info, **kwargs):
@@ -137,27 +137,27 @@ class NodeModel(BaseModel):
137137
id: int
138138
name: str
139139
labels: 'LabelsModel'
140-
140+
141141
class LabelsModel(BaseModel):
142142
node: NodeModel
143143
labels: typing.List[str]
144-
144+
145145
class Node(PydanticObjectType):
146146
class Meta:
147147
model = NodeModel
148-
148+
149149
class Labels(PydanticObjectType):
150150
class Meta:
151151
model = LabelsModel
152-
152+
153153

154154
Node.resolve_placeholders() # make the `labels` field work
155155
Labels.resolve_placeholders() # make the `node` field work
156156
```
157157

158158
### Full Examples
159159

160-
Please see [the examples directory](./examples) for more.
160+
Please see [the examples directory](./examples) for more.
161161

162162
### License
163163

@@ -175,31 +175,31 @@ Please see the [Contributing Guide](./CONTRIBUTING.md). Note that you must sign
175175

176176
#### Mappings
177177

178-
Note that even though Pydantic is perfectly happy with fields that hold mappings (e.g. dictionaries), because [GraphQL's type system doesn't have them](https://graphql.org/learn/schema/) those fields can't be exported to Graphene types. For instance, this will fail with an error `Don't know how to handle mappings in Graphene`:
178+
Note that even though Pydantic is perfectly happy with fields that hold mappings (e.g. dictionaries), because [GraphQL's type system doesn't have them](https://graphql.org/learn/schema/) those fields can't be exported to Graphene types. For instance, this will fail with an error `Don't know how to handle mappings in Graphene`:
179179

180180
``` python
181181
import typing
182182
from graphene_pydantic import PydanticObjectType
183183

184184
class Pet:
185-
pass
185+
pass
186186

187187
class Person:
188-
name: str
189-
pets_by_name: typing.Dict[str, Pet]
190-
191-
class GraphQLPerson(PydanticObjectType):
192-
class Meta:
193-
model = Person
188+
name: str
189+
pets_by_name: typing.Dict[str, Pet]
190+
191+
class GraphQLPerson(PydanticObjectType):
192+
class Meta:
193+
model = Person
194194
```
195195

196196
However, note that if you use `exclude_fields` or `only_fields` to exclude those values, there won't be a problem:
197197

198198
``` python
199199
class GraphQLPerson(PydanticObjectType):
200-
class Meta:
201-
model = Person
202-
exclude_fields = ("pets_by_name",)
200+
class Meta:
201+
model = Person
202+
exclude_fields = ("pets_by_name",)
203203
```
204204

205205
#### Union types

0 commit comments

Comments
 (0)