Skip to content

Commit

Permalink
Docs: some language cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Apr 8, 2021
1 parent 40f3aeb commit 1f50f43
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ examples.

## Getting started

An overview of GraphQL in general is available in the
A general overview of GraphQL is available in the
[README](https://github.com/graphql/graphql-spec/blob/main/README.md) for the
[Specification for GraphQL](https://github.com/graphql/graphql-spec). That overview
describes a simple set of GraphQL examples that exist as [tests](tests) in this
Expand All @@ -46,20 +46,20 @@ README and the corresponding tests in parallel.

GraphQL-core 3 can be installed from PyPI using the built-in pip command:

python -m pip install "graphql-core>=3"
python -m pip install graphql-core

Alternatively, you can also use [pipenv](https://docs.pipenv.org/) for installation in a
You can also use [pipenv](https://docs.pipenv.org/) for installation in a
virtual environment:

pipenv install "graphql-core>=3"
pipenv install graphql-core


## Usage

GraphQL-core provides two important capabilities: building a type schema, and
GraphQL-core provides two important capabilities: building a type schema and
serving queries against that type schema.

First, build a GraphQL type schema which maps to your code base:
First, build a GraphQL type schema which maps to your codebase:

```python
from graphql import (
Expand All @@ -75,7 +75,7 @@ schema = GraphQLSchema(
}))
```

This defines a simple schema with one type and one field, that resolves to a fixed
This defines a simple schema, with one type and one field, that resolves to a fixed
value. The `resolve` function can return a value, a co-routine object or a list of
these. It takes two positional arguments; the first one provides the root or the
resolved parent field, the second one provides a `GraphQLResolveInfo` object which
Expand All @@ -89,7 +89,7 @@ where the context is passed separately and arguments are passed as a single obje
Also note that GraphQL fields must be passed as a `GraphQLField` object explicitly.
Similarly, GraphQL arguments must be passed as `GraphQLArgument` objects.

A more complex example is included in the top level [tests](tests) directory.
A more complex example is included in the top-level [tests](tests) directory.

Then, serve the result of a query against that type schema.

Expand Down
4 changes: 2 additions & 2 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ Getting started

You can install GraphQL-core 3 using pip_::

pip install "graphql-core>=3"
pip install graphql-core

You can also install GraphQL-core 3 with pipenv_, if you prefer that::

pipenv install "graphql-core>=3"
pipenv install graphql-core

Now you can start using GraphQL-core 3 by importing from the top-level
:mod:`graphql` package. Nearly everything defined in the sub-packages
Expand Down
3 changes: 1 addition & 2 deletions src/graphql/language/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ def __init__(
) -> None:
"""Initialize source input.
``name`` and ``location_offset`` are optional. They are useful for clients who
store GraphQL documents in source files; for example, if the GraphQL input
starts at line 40 in a file named Foo.graphql, it might be useful for name
starts at line 40 in a file named Foo.graphql, it might be useful for ``name``
to be "Foo.graphql" and location to be ``(40, 0)``.
line and column in location_offset are 1-indexed
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/language/visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def visit(
) -> Any:
"""Visit each node in an AST.
:func:`~.visit` will walk through an AST using a depth first traversal, calling the
:func:`~.visit` will walk through an AST using a depth-first traversal, calling the
visitor's enter methods at each node in the traversal, and calling the leave methods
after visiting that node and all of its child nodes.
Expand Down

0 comments on commit 1f50f43

Please sign in to comment.