Open jweinkam opened 1 month ago
We found that default values for :include_deprecated
do not seem to be making it to the :resolve
functions. Setting the default value true
, if I drop in an IO.inspect
, the output is still showing false
.
Our solution was to copy the introspection.graphql file to our own repo and explicitly add includeDeprecated: true
like mentioned above for args
, fields
, and inputFields
. This got our schema dumps back to the behavior as it was in 1.7.6
We just ran into this after updating from 1.7.6 to 1.7.8 - this feels like a major breaking change since it now hard-removes deprecated fields from the schema. This sort of bypasses the reason to use deprecation in the first place - since the effect is equivalent to just deleting the field entirely. @benwilson512 this change was also not documented anywhere in the CHANGELOG for 1.7.7 which feels risky?
Hey @rossvz as implied by the earlier comments, this appears to be a bug, not an intended change. I do not have time to look into this this week but am happy to review any PRs that take a swing at resolving the issue.
@jgautsch I'm curious if you have ideas here, I think you were the author for https://github.com/absinthe-graphql/absinthe/pull/1291. Is there anything we need to add on the absinthe side to make this work?
We're using graphql-codegen to generate schema files for our Apollo client, but nothing on the client config side seems to get these fields to appear.
@rossvz aside from that PR I'm distant from it enough to probably not be of much help. It looks like setting the default value for includeDeprecated
arg to true
would fix your issue but maybe wouldn't be in line with the spec. Otherwise the only thing I'd think to do would be to modify your queries, but I'm sure you've thought of that so prob not helpful. I too use graphql-codegen but don't use any deprecated fields. Godspeed!
If submitting a bug, please provide the following:
Environment
Elixir version (elixir -v): Erlang/OTP 25 [erts-13.2.2.4] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] Elixir 1.14.1 (compiled with Erlang/OTP 25)
Absinthe version (mix deps | grep absinthe): absinthe 1.7.7 (Hex package) (mix) locked at 1.7.7 (absinthe) 21455198
Client Framework and version (Relay, Apollo, etc):
Expected behavior
In prior versions, when running
the generated schema.json file would contain input fields that were marked as deprecated.
Actual behavior
In this version, running the same task omits the deprecated input fields. No errors are display.
Relevant Schema/Middleware Code
Hacking the absinthe/priv/graphql/introspection.graphql file at line 44 to be
inputFields(includeDeprecated: true) {
instead of justinputFields {
adds back the deprecated input fields.