-
Notifications
You must be signed in to change notification settings - Fork 829
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expose livehtml autobuild in Makefile + Add API autodoc (#971)
* expose livehtml autobuild in Makefile * add API documentation for schema * document graphene core API * fixes black lint * Update graphene/types/union.py Co-Authored-By: Jonathan Kim <jkimbo@gmail.com> * Update graphene/types/argument.py Co-Authored-By: Jonathan Kim <jkimbo@gmail.com> * Update graphene/types/field.py Co-Authored-By: Jonathan Kim <jkimbo@gmail.com> * Update graphene/types/inputfield.py Co-Authored-By: Jonathan Kim <jkimbo@gmail.com> * add note about non-functional `interfaces` meta argument in mutation * update with other virtual environment configuration * pin autobuild * format argument example code * format enum input object and interface examples * format enum mutation union examples * revise documentation with imports, capitalization
- Loading branch information
Showing
23 changed files
with
580 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ __pycache__/ | |
# Distribution / packaging | ||
.Python | ||
env/ | ||
venv/ | ||
.venv/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
API Reference | ||
============= | ||
|
||
Schema | ||
------ | ||
|
||
.. autoclass:: graphene.types.schema.Schema | ||
:members: | ||
|
||
.. Uncomment sections / types as API documentation is fleshed out | ||
.. in each class | ||
Object types | ||
------------ | ||
|
||
.. autoclass:: graphene.ObjectType | ||
|
||
.. autoclass:: graphene.InputObjectType | ||
|
||
.. autoclass:: graphene.Mutation | ||
:members: | ||
|
||
Fields (Mounted Types) | ||
---------------------- | ||
|
||
.. autoclass:: graphene.Field | ||
|
||
.. autoclass:: graphene.Argument | ||
|
||
.. autoclass:: graphene.InputField | ||
|
||
Fields (Unmounted Types) | ||
------------------------ | ||
|
||
.. autoclass:: graphene.types.unmountedtype.UnmountedType | ||
|
||
GraphQL Scalars | ||
--------------- | ||
|
||
.. autoclass:: graphene.Int() | ||
|
||
.. autoclass:: graphene.Float() | ||
|
||
.. autoclass:: graphene.String() | ||
|
||
.. autoclass:: graphene.Boolean() | ||
|
||
.. autoclass:: graphene.ID() | ||
|
||
Graphene Scalars | ||
---------------- | ||
|
||
.. autoclass:: graphene.Date() | ||
|
||
.. autoclass:: graphene.DateTime() | ||
|
||
.. autoclass:: graphene.Time() | ||
|
||
.. autoclass:: graphene.Decimal() | ||
|
||
.. autoclass:: graphene.UUID() | ||
|
||
.. autoclass:: graphene.JSONString() | ||
|
||
Enum | ||
---- | ||
|
||
.. autoclass:: graphene.Enum() | ||
|
||
Structures | ||
---------- | ||
|
||
.. autoclass:: graphene.List | ||
|
||
.. autoclass:: graphene.NonNull | ||
|
||
Type Extension | ||
-------------- | ||
|
||
.. autoclass:: graphene.Interface() | ||
|
||
.. autoclass:: graphene.Union() | ||
|
||
Execution Metadata | ||
------------------ | ||
|
||
.. autoclass:: graphene.ResolveInfo | ||
|
||
.. autoclass:: graphene.Context | ||
|
||
.. autoclass:: graphql.execution.base.ExecutionResult | ||
|
||
.. Relay | ||
.. ----- | ||
.. .. autoclass:: graphene.Node | ||
.. .. autoclass:: graphene.GlobalID | ||
.. .. autoclass:: graphene.ClientIDMutation | ||
.. .. autoclass:: graphene.Connection | ||
.. .. autoclass:: graphene.ConnectionField | ||
.. .. autoclass:: graphene.PageInfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# Required library | ||
Sphinx==1.5.3 | ||
sphinx-autobuild==0.7.1 | ||
# Docs template | ||
http://graphene-python.org/sphinx_graphene_theme.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,25 @@ | ||
class Context(object): | ||
""" | ||
Context can be used to make a convenient container for attributes to provide | ||
for execution for resolvers of a GraphQL operation like a query. | ||
.. code:: python | ||
from graphene import Context | ||
context = Context(loaders=build_dataloaders(), request=my_web_request) | ||
schema.execute('{ hello(name: "world") }', context=context) | ||
def resolve_hello(parent, info, name): | ||
info.context.request # value set in Context | ||
info.context.loaders # value set in Context | ||
# ... | ||
args: | ||
**params (Dict[str, Any]): values to make available on Context instance as attributes. | ||
""" | ||
|
||
def __init__(self, **params): | ||
for key, value in params.items(): | ||
setattr(self, key, value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.