Skip to content

Commit 0805436

Browse files
authored
Docs on changing the name of an ObjectType (#922)
Fixes #839
1 parent ca9188a commit 0805436

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/types/objecttypes.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,17 @@ previous example you could do:
230230
peter.first_name # prints "Peter"
231231
peter.last_name # prints "Griffin"
232232
233+
Changing the name
234+
-----------------
235+
236+
By default the type name in the GraphQL schema will the same as the class name
237+
that defines the ``ObjectType``. This can be changed by setting the ``name``
238+
property on the ``Meta`` class:
239+
240+
.. code:: python
241+
242+
class MyGraphQlSong(graphene.ObjectType):
243+
class Meta:
244+
name = 'Song'
245+
233246
.. _Interface: /docs/interfaces/

0 commit comments

Comments
 (0)