Skip to content

Commit

Permalink
Include deprecated fields args
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrenner committed Oct 29, 2024
1 parent 279e4db commit 0db27b3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion priv/graphql/introspection.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fragment FullType on __Type {
fields(includeDeprecated: true) {
name
description
args {
args(includeDeprecated: true) {
...InputValue
}
type {
Expand Down
23 changes: 22 additions & 1 deletion test/mix/tasks/absinthe.schema.json_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule Mix.Tasks.Absinthe.Schema.JsonTest do
field :update_item,
type: :item,
args: [
id: [type: non_null(:string)],
id: [type: non_null(:string), deprecate: true],
item: [type: non_null(:input_item)]
]
end
Expand Down Expand Up @@ -143,6 +143,27 @@ defmodule Mix.Tasks.Absinthe.Schema.JsonTest do
assert "deprecatedField" in input_thing_field_names
assert "deprecatedFieldWithReason" in input_thing_field_names
assert "deprecatedNonNullField" in input_thing_field_names

# Includes deprecated args by default
update_item_arg_names =
get_in(
decoded_schema,
[
"data",
"__schema",
"types",
Access.filter(&(&1["name"] == "RootMutationType")),
"fields",
Access.filter(&(&1["name"] == "updateItem")),
"args",
Access.all(),
"name"
]
)
|> List.flatten()

assert "id" in update_item_arg_names
assert "item" in update_item_arg_names
end

@tag :tmp_dir
Expand Down

0 comments on commit 0db27b3

Please sign in to comment.