Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in documentation #1070

Merged
merged 2 commits into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion guides/context-and-authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ some other library that provides utilities for authenticating users you can use
those here too, and just add their output to the context.

If there is no current user it's better to simply not have the `:current_user`
key inside the map, instead of doing `%{current_user: nil}`. This way you an
key inside the map, instead of doing `%{current_user: nil}`. This way you can
just pattern match for `%{current_user: user}` in your code and not need to
worry about the nil case.

Expand Down
2 changes: 1 addition & 1 deletion guides/introspection.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ plug Absinthe.Plug.GraphiQL, schema: MyAppWeb.Schema
```

If you want to use it at a particular path (in this case `graphiql` in your Phoenix
router, simply do:
router) simply do:

```elixir
# filename: router.ex
Expand Down
2 changes: 1 addition & 1 deletion guides/schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ end
```


You may want to refer to the [Absinthe API documentation](https://hexdocs.pm/absinthe/) for more detailed information as you look this over..
You may want to refer to the [Absinthe API documentation](https://hexdocs.pm/absinthe/) for more detailed information as you look this over.


Some macros and functions used here that are worth mentioning, pulled in automatically from
Expand Down
2 changes: 1 addition & 1 deletion guides/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

There are three main approaches to testing GraphQL APIs built with Absinthe:

1. Testing resolver functions, since they do most of work.
1. Testing resolver functions, since they do most of the work.
2. Testing GraphQL document execution directly via `Absinthe.run/3`, for the bigger picture.
3. Outside-in, testing the full HTTP request/response cycle with [absinthe_plug](https://hexdocs.pm/absinthe_plug/Absinthe.Plug.html).

Expand Down
4 changes: 2 additions & 2 deletions guides/tutorial/dataloader.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This is going to get tedious and error-prone very quickly what if we could suppo
field :contacts, list_of(:contact)
field :posts, list_of(:post) do
arg :date, :date
resolve: dataloader(Content))
resolve dataloader(Content)
end
end
```
Expand Down Expand Up @@ -90,7 +90,7 @@ The loader is all set up, now let's modify the resolver to use Dataloader. In `l
field :contacts, list_of(:contact)
field :posts, list_of(:post) do
arg :date, :date
resolve: dataloader(Content))
resolve dataloader(Content)
end
end
```
Expand Down
2 changes: 1 addition & 1 deletion guides/tutorial/mutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Going back to the resolver code:

- If the match for a current user is successful, the underlying
`Blog.Content.create_post/2` function is invoked. It will return a
tuple suitable for return. (To read the Ecto-related nitty gritty,
tuple suitable for return. (To read the Ecto-related nitty-gritty,
check out the [absinthe_tutorial](https://github.com/absinthe-graphql/absinthe_tutorial)
repository.)
- If the match for a current user isn't successful, the fall-through
Expand Down
2 changes: 1 addition & 1 deletion guides/tutorial/our-first-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ end

> The GraphQL specification requires that type names be unique, TitleCased words.
> Absinthe does this automatically for us, extrapolating from our type identifier
> (in this case `:post` gives us `"Post"`. If really needed, we could provide a
> (in this case `:post` gives us `"Post"`). If really needed, we could provide a
> custom type name as a `:name` option to the `object` macro.

If you're curious what the type `:id` is used by the `:id` field, see
Expand Down
2 changes: 1 addition & 1 deletion guides/tutorial/query-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ type, `:published_at`.

The GraphQL specification doesn't define any official date or time
types, but it does support custom scalar types (you can read more
about them in the [related guide](custom-scalars.md), and
about them in the [related guide](custom-scalars.md)), and
Absinthe ships with several built-in scalar types. We'll use
`:naive_datetime` (which doesn't include timezone information) here.

Expand Down
2 changes: 1 addition & 1 deletion guides/tutorial/subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ defmodule BlogWeb.UserSocket do
<< rest of file>>
```

Lets now configure GraphQL to use this Socket.
Let's now configure GraphQL to use this Socket.

In `lib/blog_web/router.ex` :

Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/adapter/language_conventions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Absinthe.Adapter.LanguageConventions do
This defines an adapter that supports GraphQL query documents in their
conventional (in JS) camelcase notation, while allowing the schema to be
defined using conventional (in Elixir) underscore (snakecase) notation, and
tranforming the names as needed for lookups, results, and error messages.
transforming the names as needed for lookups, results, and error messages.

For example, this document:

Expand Down
10 changes: 5 additions & 5 deletions lib/absinthe/middleware.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ defmodule Absinthe.Middleware do
Middleware can be placed on a field in three different ways:

1. Using the `Absinthe.Schema.Notation.middleware/2`
macro used inside a field definition
macro used inside a field definition.
2. Using the `middleware/3` callback in your schema.
3. Returning a `{:middleware, middleware_spec, config}`
tuple from a resolution function.
Expand Down Expand Up @@ -105,7 +105,7 @@ defmodule Absinthe.Middleware do
end
```

## The `middleware/3` callback.
## The `middleware/3` callback

`middleware/3` is a function callback on a schema. When you `use
Absinthe.Schema` a default implementation of this function is placed in your
Expand Down Expand Up @@ -160,9 +160,9 @@ defmodule Absinthe.Middleware do

### Default Middleware

One use of `middleware/3` is setting the default middleware on a field
One use of `middleware/3` is setting the default middleware on a field.
By default middleware is placed on a
field that looks up a field by its snake case identifier, ie `:resource_name`
field that looks up a field by its snake case identifier, ie `:resource_name`.
Here is an example of how to change the default to use a camel cased string,
IE, "resourceName".

Expand Down Expand Up @@ -213,7 +213,7 @@ defmodule Absinthe.Middleware do
function. If no middleware was applied in the function and it also returned `[]`,
THEN Absinthe would apply the default.

This made it very easy to accidently break your schema if you weren't
This made it very easy to accidentally break your schema if you weren't
particularly careful with your pattern matching. Now the defaults are applied
FIRST by absinthe, and THEN passed to `middleware/3`. Consequently, the
middleware list argument should always have at least one value. This is also
Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/phase/schema/apply_declaration.ex
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ defmodule Absinthe.Phase.Schema.ApplyDeclaration do

defp maybe_mark_root(type_def, _root_mappings), do: type_def

# Determine which, if any, root identifier should be applied to an object type definitiona
# Determine which, if any, root identifier should be applied to an object type definition
@spec operation_root_identifier(
type_def :: Blueprint.Schema.ObjectTypeDefinition.t(),
root_mappings :: root_mappings()
Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/resolution/projector.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule Absinthe.Resolution.Projector do
Projection amounts to collecting the next set of fields to operate on, based on
the current field. This is a non trivial operation because you have to handle
the various type conditions that come along with fragments / inline fragments,
field merging, and other wondeful stuff like that.
field merging, and other wonderful stuff like that.
"""
def project(selections, %{identifier: parent_ident} = parent_type, path, cache, exec) do
path =
Expand Down
4 changes: 2 additions & 2 deletions lib/absinthe/schema.ex
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,10 @@ defmodule Absinthe.Schema do
end
```
"""
def replace_default(middleware_list, new_middleware, %{identifier: identifer}, _object) do
def replace_default(middleware_list, new_middleware, %{identifier: identifier}, _object) do
Enum.map(middleware_list, fn middleware ->
case middleware do
{Absinthe.Middleware.MapGet, ^identifer} ->
{Absinthe.Middleware.MapGet, ^identifier} ->
new_middleware

middleware ->
Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/schema/notation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ defmodule Absinthe.Schema.Notation do

# We wrap the value (from the user) in an `unquote` call, so that when the schema `blueprint` is
# placed into `__absinthe_blueprint__` via `unquote(Macro.escape(blueprint, unquote: true))` the
# value get's unquoted. This allows us to evaluate function calls in the scope of the schema
# value gets unquoted. This allows us to evaluate function calls in the scope of the schema
# module.
defp wrap_in_unquote(value) do
{:unquote, [], [value]}
Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/schema/provider.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Absinthe.Schema.Provider do
@moduledoc """
Experimental: Behaviour for providing schema data

This behaviour is experimental and may change significatly in patch releases.
This behaviour is experimental and may change significantly in patch releases.
"""

@type schema_identifier :: term
Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/subscription/pubsub.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ defmodule Absinthe.Subscription.Pubsub do
Processes need only subscribe to the pubsub process that
is running on their own node.

However, mutations can happen on any node in the custer and must to be
However, mutations can happen on any node in the cluster and must to be
broadcast to other nodes so that they can also reevaluate their GraphQL
subscriptions and notify subscribers on that node.

Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/type/directive.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule Absinthe.Type.Directive do
@typedoc """
A defined directive.

* `:name` - The name of the directivee. Should be a lowercase `binary`. Set automatically.
* `:name` - The name of the directive. Should be a lowercase `binary`. Set automatically.
* `:description` - A nice description for introspection.
* `:args` - A map of `Absinthe.Type.Argument` structs. See `Absinthe.Schema.Notation.arg/2`.
* `:locations` - A list of places the directives can be used.
Expand Down
2 changes: 1 addition & 1 deletion test/absinthe/extensions_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ defmodule Absinthe.ExtensionsTest do
assert bp.result == %{data: %{"foo" => "hello world"}, extensions: %{foo: 1}}
end

test "Result phase doesn't clober the extensions" do
test "Result phase doesn't clobber the extensions" do
doc = "{foo}"

pipeline =
Expand Down
2 changes: 1 addition & 1 deletion test/absinthe/phase/execution/non_null_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ defmodule Absinthe.Phase.Document.Execution.NonNullTest do
assert {:ok, %{data: data, errors: errors}} == Absinthe.run(doc, Schema)
end

test "error propogation to root field returns nil on data" do
test "error propagation to root field returns nil on data" do
doc = """
{
nullable { nullable { nonNullErrorField }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ defmodule Absinthe.Schema.Rule.ObjectMustImplementInterfacesTest do
end
end

test "interfaces are propogated across type imports" do
test "interfaces are propagated across type imports" do
assert %{
named: [:cat, :dog, :user],
favorite_foods: [:cat, :dog, :user],
Expand Down