擅长:python、mysql、java
<p>{a1}还没有一个REST的替代方法。因此,“惯例”在我们说话的时候就产生了。在</p>
<p>然而,由于<code>schema</code>是一般定义的术语,您可以将其重命名为<code>queries</code>。在</p>
<p>这是我的项目结构:</p>
<pre><code>django_proj/
manage.py
requirements.txt
my_app/
__init__.py
migrations/
admin.py
schema/
__init__.py
schema.py # holds the class Query. The GraphQL endpoints, if you like
types.py # holds the DjangoObjectType classes
inputs.py # holds the graphene.InputObjectType classes (for defining input to a query or mutation)
mutations.py # holds the mutations (what else?!)
</code></pre>
<p>因此,<code>schema.py</code>(<code>__init__</code>)可以根据需要重命名为<code>queries.py</code>。这两个词之间没有太大的区别。在</p>