Current section

122 Versions

Jump to

Compare versions

76 files changed
+2069 additions
-447 deletions
  @@ -14,13 +14,19 @@ locals_without_parens = [
14 14 enum: 2,
15 15 enum: 3,
16 16 expand: 1,
17 + extend: 1,
18 + extend: 2,
17 19 field: 2,
18 20 field: 3,
19 21 field: 4,
22 + import_directives: 1,
23 + import_directives: 2,
20 24 import_fields: 2,
21 25 import_fields: 1,
22 26 import_types: 1,
23 27 import_types: 2,
28 + import_type_extensions: 1,
29 + import_type_extensions: 2,
24 30 import_sdl: 1,
25 31 import_sdl: 2,
26 32 input_object: 3,
  @@ -1,5 +1,25 @@
1 1 # Changelog
2 2
3 + ## 1.7.1
4 + - Bug Fix: [Validate field identifier uniqueness](https://github.com/absinthe-graphql/absinthe/pull/1200)
5 + - Bug Fix: [Validate type references for invalid wrapped types](https://github.com/absinthe-graphql/absinthe/pull/1195)
6 + - Breaking Bugfix: [Validate repeatable directives on schemas](https://github.com/absinthe-graphql/absinthe/pull/1179)
7 + - Bug Fix: Adds **optional fix** for non compliant built-in scalar Int type. `use Absinthe.Schema, use_spec_compliant_int_scalar: true` in your schema to use the fixed Int type. It is also advisable to upgrade for custom types if you are leveraging the use of integers outside the GraphQl standard. [#1131](https://github.com/absinthe-graphql/absinthe/pull/1131).
8 + - Feature: [Support error tuples when scalar parsing fails](https://github.com/absinthe-graphql/absinthe/pull/1187)
9 + - Feature: [Convert SDL Language.\* structs to SDL notation](https://github.com/absinthe-graphql/absinthe/pull/1160)
10 + - Feature: [Support passing the resolution struct to dataloader helper callbacks](https://github.com/absinthe-graphql/absinthe/pull/1211)
11 + - Feature: [Add support for type extensions](https://github.com/absinthe-graphql/absinthe/pull/1157)
12 + - Bug Fix: [Add type system directives to introspection results](https://github.com/absinthe-graphql/absinthe/pull/1189)
13 + - Bug Fix: [Add `__private__` field to EnumValueDefinition](https://github.com/absinthe-graphql/absinthe/pull/1148)
14 + - Bug Fix: [Fix bug in Schema.**absinthe_types**(:all) for Persistent Term](https://github.com/absinthe-graphql/absinthe/pull/1161)
15 + - Bug Fix: [Fix default enum value check for SDL schema's](https://github.com/absinthe-graphql/absinthe/pull/1188)
16 + - Bug Fix: [Add "Objects must define fields" schema validation](https://github.com/absinthe-graphql/absinthe/pull/1167)
17 + - Feature: [Add `import_directives` macro](https://github.com/absinthe-graphql/absinthe/pull/1158)
18 + - Feature: [Support type extensions on schema declarations](https://github.com/absinthe-graphql/absinthe/pull/1176)
19 + - Bug Fix: [Root objects are marked as referenced correctly](https://github.com/absinthe-graphql/absinthe/pull/1186)
20 + - Bug Fix: [Prevent DDOS attacks with long queries](https://github.com/absinthe-graphql/absinthe/pull/1220)
21 + - Feature: [pipeline_modifier option to Absinthe.run/3](https://github.com/absinthe-graphql/absinthe/pull/1221)
22 +
3 23 ## 1.7.0
4 24
5 25 - POTENTIALLY BREAKING 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.
  @@ -16,6 +36,7 @@
16 36
17 37 Originally included the items from 1.7.0, but the spec validation fix was considered
18 38 too impactful for a patch release.
39 +
19 40 ## 1.6.6
20 41
21 42 - Feature: [Update telemetry dependency to stable ~> 1.0](https://github.com/absinthe-graphql/absinthe/pull/1097)
  @@ -7,7 +7,7 @@
7 7 [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
8 8 [![Last Updated](https://img.shields.io/github/last-commit/absinthe-graphql/absinthe.svg)](https://github.com/absinthe-graphql/absinthe/commits/master)
9 9
10 - [GraphQL](https://facebook.github.io/graphql/) implementation for Elixir.
10 + [GraphQL](https://github.com/graphql-elixir/graphql) implementation for Elixir.
11 11
12 12 Goals:
13 13
  @@ -17,7 +17,7 @@ Goals:
17 17 - Detailed error messages and documentation.
18 18 - A focus on robustness and production-level performance.
19 19
20 - Please see the website at [http://absinthe-graphql.org](http://absinthe-graphql.org).
20 + Please see the website at [https://absinthe-graphql.org](https://absinthe-graphql.org).
21 21
22 22 ## Why Use Absinthe?
23 23
  @@ -61,7 +61,7 @@ We care about support for third-party frameworks, both on the back and
61 61 front end.
62 62
63 63 So far, we include specialized support for Phoenix and Plug on the backend,
64 - and [Relay](https://facebook.github.io/relay/) on the frontend.
64 + and [Relay](https://relay.dev/) on the frontend.
65 65
66 66 Of course we work out of the box with other frontend frameworks and GraphQL
67 67 clients, too.
  @@ -72,7 +72,7 @@ Install from [Hex.pm](https://hex.pm/packages/absinthe):
72 72
73 73 ```elixir
74 74 def deps do
75 - [{:absinthe, "~> 1.6.0"}]
75 + [{:absinthe, "~> 1.7.0"}]
76 76 end
77 77 ```
78 78
  @@ -86,7 +86,7 @@ See [CHANGELOG](./CHANGELOG.md) for upgrade steps between versions.
86 86
87 87 - [Absinthe hexdocs](https://hexdocs.pm/absinthe).
88 88 - For the tutorial, guides, and general information about Absinthe-related
89 - projects, see [http://absinthe-graphql.org](http://absinthe-graphql.org).
89 + projects, see [https://absinthe-graphql.org](https://absinthe-graphql.org).
90 90
91 91 ### Mix Tasks
  @@ -71,10 +71,13 @@
71 71 <<"lib/absinthe/phase/subscription/subscribe_self.ex">>,
72 72 <<"lib/absinthe/phase/subscription/result.ex">>,
73 73 <<"lib/absinthe/phase/parse.ex">>,<<"lib/absinthe/phase/schema">>,
74 + <<"lib/absinthe/phase/schema/type_extension_imports.ex">>,
75 + <<"lib/absinthe/phase/schema/apply_type_extensions.ex">>,
74 76 <<"lib/absinthe/phase/schema/field_imports.ex">>,
75 77 <<"lib/absinthe/phase/schema/hydrate.ex">>,
78 + <<"lib/absinthe/phase/schema/spec_compliant_int.ex">>,
76 79 <<"lib/absinthe/phase/schema/build.ex">>,
77 - <<"lib/absinthe/phase/schema/deprecated_directive_fields.ex">>,
80 + <<"lib/absinthe/phase/schema/import_prototype_directives.ex">>,
78 81 <<"lib/absinthe/phase/schema/populate_persistent_term.ex">>,
79 82 <<"lib/absinthe/phase/schema/reformat_descriptions.ex">>,
80 83 <<"lib/absinthe/phase/schema/validation.ex">>,
  @@ -94,6 +97,7 @@
94 97 <<"lib/absinthe/phase/schema/validation/type_names_are_unique.ex">>,
95 98 <<"lib/absinthe/phase/schema/validation/names_must_be_valid.ex">>,
96 99 <<"lib/absinthe/phase/schema/validation/object_interfaces_must_be_valid.ex">>,
100 + <<"lib/absinthe/phase/schema/validation/object_must_define_fields.ex">>,
97 101 <<"lib/absinthe/phase/schema/validation/known_directives.ex">>,
98 102 <<"lib/absinthe/phase/schema/validation/object_must_implement_interfaces.ex">>,
99 103 <<"lib/absinthe/phase/schema/validation/no_interface_cycles.ex">>,
  @@ -107,6 +111,7 @@
107 111 <<"lib/absinthe/phase/schema/validation/interfaces_must_resolve_types.ex">>,
108 112 <<"lib/absinthe/phase/schema/validation/default_enum_value_present.ex">>,
109 113 <<"lib/absinthe/phase/schema/validation/input_output_types_correctly_placed.ex">>,
114 + <<"lib/absinthe/phase/schema/directive_imports.ex">>,
110 115 <<"lib/absinthe/phase/init.ex">>,<<"lib/absinthe/phase/schema.ex">>,
111 116 <<"lib/absinthe/phase/validation.ex">>,<<"lib/absinthe/phase/debug.ex">>,
112 117 <<"lib/absinthe/phase/validation">>,
  @@ -182,6 +187,8 @@
182 187 <<"lib/absinthe/type/interface.ex">>,<<"lib/absinthe/type/scalar.ex">>,
183 188 <<"lib/absinthe/type/built_ins">>,<<"lib/absinthe/type/built_ins/scalars">>,
184 189 <<"lib/absinthe/type/built_ins/scalars/utils.ex">>,
190 + <<"lib/absinthe/type/built_ins/spec_compliant_int.ex">>,
191 + <<"lib/absinthe/type/built_ins/deprecated_directive_fields.ex">>,
185 192 <<"lib/absinthe/type/built_ins/scalars.ex">>,
186 193 <<"lib/absinthe/type/built_ins/directives.ex">>,
187 194 <<"lib/absinthe/type/built_ins/introspection.ex">>,
  @@ -244,6 +251,7 @@
244 251 <<"lib/absinthe/blueprint/schema/enum_value_definition.ex">>,
245 252 <<"lib/absinthe/blueprint/schema/field_definition.ex">>,
246 253 <<"lib/absinthe/blueprint/schema/input_object_type_definition.ex">>,
254 + <<"lib/absinthe/blueprint/schema/type_extension_definition.ex">>,
247 255 <<"lib/absinthe/blueprint/schema/object_type_definition.ex">>,
248 256 <<"lib/absinthe/blueprint/schema/enum_type_definition.ex">>,
249 257 <<"lib/absinthe/blueprint/schema/interface_type_definition.ex">>,
  @@ -273,7 +281,7 @@
273 281 {<<"name">>,<<"nimble_parsec">>},
274 282 {<<"optional">>,false},
275 283 {<<"repository">>,<<"hexpm">>},
276 - {<<"requirement">>,<<"~> 0.5 or ~> 1.0">>}],
284 + {<<"requirement">>,<<"~> 1.2.2 or ~> 1.3.0">>}],
277 285 [{<<"app">>,<<"telemetry">>},
278 286 {<<"name">>,<<"telemetry">>},
279 287 {<<"optional">>,false},
  @@ -289,4 +297,4 @@
289 297 {<<"optional">>,true},
290 298 {<<"repository">>,<<"hexpm">>},
291 299 {<<"requirement">>,<<"~> 1.0 or ~> 2.0">>}]]}.
292 - {<<"version">>,<<"1.7.0">>}.
300 + {<<"version">>,<<"1.7.1">>}.
  @@ -3,7 +3,7 @@ defmodule Absinthe do
3 3 Documentation for the Absinthe package, a toolkit for building GraphQL
4 4 APIs with Elixir.
5 5
6 - For usage information, see [the documentation](http://hexdocs.pm/absinthe), which
6 + For usage information, see [the documentation](https://hexdocs.pm/absinthe), which
7 7 includes guides, API information for important modules, and links to useful resources.
8 8 """
9 9
  @@ -49,6 +49,8 @@ defmodule Absinthe do
49 49 | %{data: nil | result_selection_t, errors: [result_error_t]}
50 50 | %{errors: [result_error_t]}
51 51
52 + @type pipeline_modifier_fun :: (Absinthe.Pipeline.t(), Keyword.t() -> Absinthe.Pipeline.t())
53 +
52 54 @doc """
53 55 Evaluates a query document against a schema, with options.
54 56
  @@ -92,7 +94,8 @@ defmodule Absinthe do
92 94 operation_name: String.t(),
93 95 analyze_complexity: boolean,
94 96 variables: %{optional(String.t()) => any()},
95 - max_complexity: non_neg_integer | :infinity
97 + max_complexity: non_neg_integer | :infinity,
98 + pipeline_modifier: pipeline_modifier_fun()
96 99 ]
97 100
98 101 @type run_result :: {:ok, result_t} | {:error, String.t()}
  @@ -103,9 +106,12 @@ defmodule Absinthe do
103 106 run_opts
104 107 ) :: run_result
105 108 def run(document, schema, options \\ []) do
109 + pipeline_modifier = options[:pipeline_modifier] || (&pipeline_identity/2)
110 +
106 111 pipeline =
107 112 schema
108 113 |> Absinthe.Pipeline.for_document(options)
114 + |> pipeline_modifier.(options)
109 115
110 116 case Absinthe.Pipeline.run(document, pipeline) do
111 117 {:ok, %{result: result}, _phases} ->
  @@ -126,7 +132,7 @@ defmodule Absinthe do
126 132 @spec run!(
127 133 binary | Absinthe.Language.Source.t() | Absinthe.Language.Document.t(),
128 134 Absinthe.Schema.t(),
129 - Keyword.t()
135 + run_opts
130 136 ) :: result_t | no_return
131 137 def run!(input, schema, options \\ []) do
132 138 case run(input, schema, options) do
  @@ -134,4 +140,6 @@ defmodule Absinthe do
134 140 {:error, err} -> raise ExecutionError, message: err
135 141 end
136 142 end
143 +
144 + defp pipeline_identity(pipeline, _options), do: pipeline
137 145 end
Loading more files…