Skip to content

Commit 72bc96d

Browse files
committed
Fix issues with Sphinx docs and add docs test
1 parent 3ca6d64 commit 72bc96d

36 files changed

+280
-114
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: python
22

33
matrix:
44
include:
5-
- env: TOXENV=black,flake8,mypy
5+
- env: TOXENV=black,flake8,mypy,docs
66
python: 3.7
77
dist: xenial
88
sudo: true

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@
115115
# If true, `todo` and `todoList` produce output, else they produce nothing.
116116
todo_include_todos = False
117117

118-
119118
# -- Options for HTML output ----------------------------------------------
120119

121120
# The theme to use for HTML and HTML Help pages. See the documentation for

docs/intro.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ Now you can start using GraphQL-core-next by importing from the top-level
4141
:mod:`graphql` package. Nearly everything defined in the sub-packages
4242
can also be imported directly from the top-level package.
4343

44+
.. currentmodule:: graphql
45+
4446
For instance, using the types defined in the :mod:`graphql.type` package,
4547
you can define a GraphQL schema, like this simple one::
4648

docs/modules/error.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Error
22
=====
33

4+
.. currentmodule:: graphql.error
5+
46
.. automodule:: graphql.error
57

68
.. autoexception:: GraphQLError
@@ -10,6 +12,4 @@ Error
1012
.. autofunction:: print_error
1113
.. autofunction:: format_error
1214

13-
The :mod:`graphql.error` module also contains the :const:`INVALID` singleton that is
14-
used to describe invalid or undefined values and corresponds to the ``undefined``
15-
value in GraphQL.js.
15+
.. autodata:: INVALID

docs/modules/execution.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Execution
22
=========
33

4+
.. currentmodule:: graphql.execution
5+
46
.. automodule:: graphql.execution
57

68
.. autofunction:: execute

docs/modules/graphql.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Reference
22
=========
33

4+
.. currentmodule:: graphql
5+
46
.. automodule:: graphql
57

68
.. _top-level-functions:

docs/modules/language.rst

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,25 @@ Visitor
9999
.. autoclass:: ParallelVisitor
100100
.. autoclass:: TypeInfoVisitor
101101

102-
The module also exports the constants :const:`BREAK`, :const:`SKIP`, :const:`REMOVE` and
103-
:const:`IDLE` that are used as special return values in the :class:`Visitor` methods.
102+
The module also exports the following special symbols which can be used as
103+
return values in the :class:`Visitor` methods to signal particular actions:
104+
105+
.. data:: BREAK
106+
:annotation: = True
107+
108+
This return value signals that no further nodes shall be visited.
109+
110+
.. data:: SKIP
111+
:annotation: = False
112+
113+
This return value signals that the current node shall be skipped.
114+
115+
.. data:: REMOVE
116+
:annotation: = Ellipsis
117+
118+
This return value signals that the current node shall be deleted.
119+
120+
.. data:: IDLE
121+
:annotation: = None
122+
123+
This return value signals that no additional action shall take place.

docs/modules/pyutils.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
PyUtils
22
=======
33

4+
.. currentmodule:: graphql.pyutils
5+
46
.. automodule:: graphql.pyutils
57

68
.. autofunction:: camel_to_snake
@@ -18,5 +20,6 @@ PyUtils
1820
.. autofunction:: or_list
1921
.. autofunction:: quoted_or_list
2022
.. autofunction:: suggestion_list
21-
.. autofunction:: ReadOnlyError
22-
.. autofunction:: ReadOnlyList
23+
.. autoclass:: ReadOnlyError
24+
.. autoclass:: ReadOnlyList
25+
.. autoclass:: ReadOnlyDict

docs/modules/subscription.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Subscription
22
============
33

4+
.. currentmodule:: graphql.subscription
5+
46
.. automodule:: graphql.subscription
57

68
.. autofunction:: subscribe

docs/modules/type.rst

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
Type
22
====
33

4+
.. currentmodule:: graphql.type
5+
46
.. automodule:: graphql.type
57

8+
69
Definition
710
----------
811

@@ -99,6 +102,7 @@ Resolvers
99102
.. autoclass:: GraphQLTypeResolver
100103
.. autoclass:: ResponsePath
101104

105+
102106
Directives
103107
----------
104108

@@ -116,11 +120,13 @@ Definitions
116120
.. autoclass:: GraphQLSkipDirective
117121
.. autoclass:: GraphQLDeprecatedDirective
118122

119-
The list of all specified directives is available as
120-
:data:`specified_directives`.
123+
.. autodata:: specified_directives
124+
125+
.. data:: DEFAULT_DEPRECATION_REASON
126+
:annotation: = 'No longer supported'
127+
128+
String constant that can be used as the default value for ``deprecation_reason``.
121129

122-
The module also exports the constant :const:`DEFAULT_DEPRECATION_REASON`
123-
that can be used as the default value for :obj:`deprecation_reason`.
124130

125131
Introspection
126132
-------------
@@ -130,7 +136,6 @@ Predicates
130136

131137
.. autofunction:: is_introspection_type
132138

133-
134139
Definitions
135140
^^^^^^^^^^^
136141

@@ -139,8 +144,8 @@ Definitions
139144
.. autoclass:: TypeNameMetaFieldDef
140145
.. autoclass:: SchemaMetaFieldDef
141146

142-
The list of all introspection types is available as
143-
:data:`introspection_types`.
147+
.. autodata:: introspection_types
148+
144149

145150
Scalars
146151
-------
@@ -162,6 +167,7 @@ Definitions
162167
The list of all specified directives is available as
163168
:data:`specified_directives`.
164169

170+
165171
Schema
166172
------
167173

@@ -184,7 +190,6 @@ Functions:
184190

185191
.. autofunction:: validate_schema
186192

187-
188193
Assertions
189194
^^^^^^^^^^
190195

0 commit comments

Comments
 (0)