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

Update changelog and improve docs #1143

Merged
merged 3 commits into from
Jan 19, 2022
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
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

## 1.6.7

- Bug Fix: [Fix check unknown types to also cover wrapped types](https://github.com/absinthe-graphql/absinthe/pull/1138)
- Feature: [Add GraphQL document formatter](https://github.com/absinthe-graphql/absinthe/pull/1114)
- Bug Fix: [Fix Phase.Schema.Validation.InputOutputTypesCorrectlyPlaced not applied to SDL schema's](https://github.com/absinthe-graphql/absinthe/pull/1142/files)
- Bug Fix: [Use inspect/1 to safely encode bad binary samples](https://github.com/absinthe-graphql/absinthe/pull/1121)
- Bug Fix: [key :is_type_of not found on Interface ](https://github.com/absinthe-graphql/absinthe/issues/1077)
- Bug Fix: [Validate object/interfaces implement all transitive interfaces](https://github.com/absinthe-graphql/absinthe/pull/1127)
- Bug Fix: [Fix check unknown types to also cover wrapped types](https://github.com/absinthe-graphql/absinthe/pull/1138) This could break incoming documents previously considered valid. Skip the `Absinthe.Phase.Validation.KnownTypeNames` phase to avoid this check. See `Absinthe.Pipeline` on adjusting the document pipeline.
- Bug Fix: [Validate field names are unique to an object, interface or an input object](https://github.com/absinthe-graphql/absinthe/pull/1135)
- Bug Fix: [Validate variable usage in according to spec](https://github.com/absinthe-graphql/absinthe/pull/1141)
- Bug Fix: [Validate variable usage in according to spec](https://github.com/absinthe-graphql/absinthe/pull/1141). This could break incoming documents previously considered valid. Skip the `Absinthe.Phase.Document.Arguments.VariableTypesMatch` phase to avoid this check. See `Absinthe.Pipeline` on adjusting the document pipeline.

## 1.6.6

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 @@ -10,7 +10,7 @@ defmodule Absinthe.Adapter.LanguageConventions do

For example, this document:

```
```graphql
{
myUser: createUser(userId: 2) {
firstName
Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/blueprint/execution.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Absinthe.Blueprint.Execution do
drive a document's execution.

Here's how the execution flow works. Given a document like:
```
```graphql
{
posts {
title
Expand Down
24 changes: 13 additions & 11 deletions lib/absinthe/formatter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ defmodule Absinthe.Formatter do
Will format files with the extensions .graphql or .gql

## Example

Absinthe.Formatter.format("{ version }")
"{\n version\n}\n"
```elixir
Absinthe.Formatter.format("{ version }")
"{\n version\n}\n"
```


From Elixir 1.13 onwards the Absinthe.Formatter can be added to
the formatter as a plugin:

# .formatter.exs
[
# Define the desired plugins
plugins: [Absinthe.Formatter],
# Remember to update the inputs list to include the new extensions
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}", "{lib, priv}/**/*.{gql,graphql}"]
]

```elixir
# .formatter.exs
[
# Define the desired plugins
plugins: [Absinthe.Formatter],
# Remember to update the inputs list to include the new extensions
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}", "{lib, priv}/**/*.{gql,graphql}"]
]
```
"""

def features(_opts) do
Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/middleware.ex
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ defmodule Absinthe.Middleware do
```

Given a document like:
```
```graphql
{ lookupUser { name }}
```

Expand Down
2 changes: 2 additions & 0 deletions lib/absinthe/phase/document/arguments/variable_types_match.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
defmodule Absinthe.Phase.Document.Arguments.VariableTypesMatch do
@moduledoc false

# Implements: 5.8.5. All Variable Usages are Allowed
# Specifically, it implements "Variable usages must be compatible with the arguments they are passed to."
# See relevant counter-example: https://spec.graphql.org/draft/#example-2028e
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
defmodule Absinthe.Phase.Document.Validation.Utils.MessageSuggestions do
@moduledoc false
@suggest 5

@doc """
Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/phase/document/variables.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule Absinthe.Phase.Document.Variables do
#
# Given a GraphQL document that looks like:
#
# ```
# ```graphql
# query Item($id: ID!, $text = String = "Another") {
# item(id: $id, category: "Things") {
# name
Expand Down
12 changes: 12 additions & 0 deletions lib/absinthe/pipeline.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ defmodule Absinthe.Pipeline do

A pipeline is merely a list of phases. This module contains functions for building,
modifying, and executing pipelines of phases.

Pipelines are used to build, validate and manipulate GraphQL documents or schema's.

* See [`Absinthe.Plug`](https://hexdocs.pm/absinthe_plug/Absinthe.Plug.html) on adjusting the document pipeline for GraphQL over http requests.
* See [`Absinthe.Phoenix`](https://hexdocs.pm/absinthe_phoenix/) on adjusting the document pipeline for GraphQL over Phoenix channels.
* See `Absinthe.Schema` on adjusting the schema pipeline for schema manipulation.
"""

alias Absinthe.Phase
Expand Down Expand Up @@ -38,6 +44,9 @@ defmodule Absinthe.Pipeline do

@spec for_document(Absinthe.Schema.t()) :: t
@spec for_document(Absinthe.Schema.t(), Keyword.t()) :: t
@doc """
The default document pipeline
"""
def for_document(schema, options \\ []) do
options = options(Keyword.put(options, :schema, schema))

Expand Down Expand Up @@ -115,6 +124,9 @@ defmodule Absinthe.Pipeline do

@spec for_schema(nil | Absinthe.Schema.t()) :: t
@spec for_schema(nil | Absinthe.Schema.t(), Keyword.t()) :: t
@doc """
The default schema pipeline
"""
def for_schema(schema, options \\ []) do
options =
options
Expand Down
6 changes: 3 additions & 3 deletions lib/absinthe/resolution.ex
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ defmodule Absinthe.Resolution do

## Examples
Given some query:
```
```graphql
{users { email }}
```

Expand Down Expand Up @@ -146,7 +146,7 @@ defmodule Absinthe.Resolution do
## Example

Given a document like:
```
```graphql
{ user { id name }}
```

Expand All @@ -162,7 +162,7 @@ defmodule Absinthe.Resolution do
`child_fields` will be `["id", "name"]`.

It correctly handles fragments, so for example if you had the document:
```
```graphql
{
user {
... on User {
Expand Down
4 changes: 2 additions & 2 deletions lib/absinthe/schema.ex
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ defmodule Absinthe.Schema do
When you push a mutation, you can have selections on that mutation result
to get back data you need, IE

```
```graphql
mutation {
createUser(accountId: 1, name: "bob") {
id
Expand All @@ -218,7 +218,7 @@ defmodule Absinthe.Schema do
However, what if you want to know when OTHER people create a new user, so that
your UI can update as well. This is the point of subscriptions.

```
```graphql
subscription {
newUsers {
id
Expand Down
2 changes: 1 addition & 1 deletion lib/absinthe/type/object.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defmodule Absinthe.Type.Object do
Given we have a query that supports getting a person by name
(see `Absinthe.Schema`), and a query document like the following:

```
```graphql
{
person(name: "Joe") {
name
Expand Down
9 changes: 6 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ defmodule Absinthe.Mixfile do
"guides/client/apollo.md",
"guides/client/relay.md",
"guides/upgrading/v1.4.md",
"guides/upgrading/v1.5.md"
"guides/upgrading/v1.5.md",
"CHANGELOG.md"
]
end

Expand All @@ -132,7 +133,8 @@ defmodule Absinthe.Mixfile do
Tutorial: ~r/guides\/tutorial\/.*/,
Topics: ~r/guides\/[^\/]+\.md/,
"Client Guides": ~r/guides\/client\/.*/,
"Upgrade Guides": ~r/guides\/upgrading\/.*/
"Upgrade Guides": ~r/guides\/upgrading\/.*/,
Changelog: "CHANGELOG.md"
]
end

Expand Down Expand Up @@ -176,7 +178,8 @@ defmodule Absinthe.Mixfile do
Subscriptions: [
Absinthe.Subscription,
Absinthe.Subscription.Pubsub,
Absinthe.Subscription.Local
Absinthe.Subscription.Local,
Absinthe.Subscription.PipelineSerializer
],
Extensibility: [
Absinthe.Pipeline,
Expand Down
8 changes: 4 additions & 4 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"},
"deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"},
"dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"},
"earmark_parser": {:hex, :earmark_parser, "1.4.15", "b29e8e729f4aa4a00436580dcc2c9c5c51890613457c193cc8525c388ccb2f06", [:mix], [], "hexpm", "044523d6438ea19c1b8ec877ec221b008661d3c27e3b848f4c879f500421ca5c"},
"earmark_parser": {:hex, :earmark_parser, "1.4.19", "de0d033d5ff9fc396a24eadc2fcf2afa3d120841eb3f1004d138cbf9273210e8", [:mix], [], "hexpm", "527ab6630b5c75c3a3960b75844c314ec305c76d9899bb30f71cb85952a9dc45"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"ex_doc": {:hex, :ex_doc, "0.25.2", "4f1cae793c4d132e06674b282f1d9ea3bf409bcca027ddb2fe177c4eed6a253f", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "5b0c172e87ac27f14dfd152d52a145238ec71a95efbf29849550278c58a393d6"},
"ex_doc": {:hex, :ex_doc, "0.27.3", "d09ed7ab590b71123959d9017f6715b54a448d76b43cf909eb0b2e5a78a977b2", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "ee60b329d08195039bfeb25231a208749be4f2274eae42ce38f9be0538a2f2e6"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"makeup": {:hex, :makeup, "1.0.5", "d5a830bc42c9800ce07dd97fa94669dfb93d3bf5fcf6ea7a0c67b2e0e4a7f26c", [:mix], [{:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cfa158c02d3f5c0c665d0af11512fed3fba0144cf1aadee0f2ce17747fba2ca9"},
"makeup_elixir": {:hex, :makeup_elixir, "0.15.1", "b5888c880d17d1cc3e598f05cdb5b5a91b7b17ac4eaf5f297cb697663a1094dd", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "db68c173234b07ab2a07f645a5acdc117b9f99d69ebf521821d89690ae6c6ec8"},
"makeup_elixir": {:hex, :makeup_elixir, "0.15.2", "dc72dfe17eb240552857465cc00cce390960d9a0c055c4ccd38b70629227e97c", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "fd23ae48d09b32eff49d4ced2b43c9f086d402ee4fd4fcb2d7fad97fa8823e75"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
"makeup_graphql": {:hex, :makeup_graphql, "0.1.2", "81e2939aab6d2b81d39ee5d9e13fae02599e9ca6e1152e0eeed737a98a5f96aa", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "3390ab04ba388d52a94bbe64ef62aa4d7923ceaffac43ec948f58f631440e8fb"},
"mix_test_watch": {:hex, :mix_test_watch, "1.0.2", "34900184cbbbc6b6ed616ed3a8ea9b791f9fd2088419352a6d3200525637f785", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm", "47ac558d8b06f684773972c6d04fcc15590abdb97aeb7666da19fcbfdc441a07"},
"nimble_parsec": {:hex, :nimble_parsec, "1.1.0", "3a6fca1550363552e54c216debb6a9e95bd8d32348938e13de5eda962c0d7f89", [:mix], [], "hexpm", "08eb32d66b706e913ff748f11694b17981c0b04a33ef470e33e11b3d3ac8f54b"},
"nimble_parsec": {:hex, :nimble_parsec, "1.2.0", "b44d75e2a6542dcb6acf5d71c32c74ca88960421b6874777f79153bbbbd7dccc", [:mix], [], "hexpm", "52b2871a7515a5ac49b00f214e4165a40724cf99798d8e4a65e4fd64ebd002c1"},
"telemetry": {:hex, :telemetry, "0.4.3", "a06428a514bdbc63293cd9a6263aad00ddeb66f608163bdec7c8995784080818", [:rebar3], [], "hexpm", "eb72b8365ffda5bed68a620d1da88525e326cb82a75ee61354fc24b844768041"},
}