We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9dcd798 + 0daf6d8 commit 90889caCopy full SHA for 90889ca
docs/pages/docs/basic-types.md
@@ -82,3 +82,21 @@ graphene.Field(graphene.String(), to=graphene.String())
82
# Is equivalent to:
83
graphene.Field(graphene.String(), to=graphene.Argument(graphene.String()))
84
```
85
+
86
87
+## Using custom object types as argument
88
89
+To use a custom object type as an argument, you need to inherit `graphene.InputObjectType`, not `graphene.ObjectType`.
90
91
+```python
92
+class CustomArgumentObjectType(graphene.InputObjectType):
93
+ field1 = graphene.String()
94
+ field2 = graphene.String()
95
96
+```
97
98
+Then, when defining this in an argument, you need to wrap it in an `Argument` object.
99
100
101
+graphene.Field(graphene.String(), to=graphene.Argument(CustomArgumentObjectType))
102
0 commit comments