Deprecated field visibility #3191
Replies: 3 comments
-
Note that if you don't code fence |
Beta Was this translation helpful? Give feedback.
-
@pjungels-paraport hmmm.. I wonder, is there perhaps a bug in your server implementation then? the error message seems to indicate that the server doesn't recognize the deprecated field. If this were the case, then it would be missing in the introspection query response, or however the schema is constructed if you use schema prop instead of http introspection. On the other hand, if you do see the deprecated field in question in the http introspection response or in the schema instance, then we might have a bug on our end! |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response @acao ! I played around with introspection in my project and have some new findings. Running this query:
returned this result:
So the deprecated field is discoverable through introspection. However, when I try to use the deprecated argument in a query, the GraphiQL UI gives me this message: The GraphiQL documentation explorer still doesn't show the deprecated argument (as in my original post). |
Beta Was this translation helpful? Give feedback.
-
Greetings!
I'm relatively new to GraphQL, so I might be doing something wrong here. Anyway, I am trying to deprecate some fields in our schema using the @deprecated(reason: "reason") directive. When I add the directive, the deprecated fields are no longer visible in GraphiQL and if I try to use the deprecated field in a query I get this error message: "Field is not defined by type . Did you mean <other field name 1> or <other field name 2>?"
I expected that the deprecated fields wouldn't be discoverable, but that they would show up with a warning that they are deprecated. However, the fields aren't even showing up for me. Here's a quick example:
Schema snippet:
Screenshot from GraphiQL showing the "enhanced" argument isn't available:
Do I need to do something specific so that the deprecated fields still show up in GraphiQL?
Thanks!
Paul
Beta Was this translation helpful? Give feedback.
All reactions