GraphQL schema accessibility metadata handling in Apollo Server 4 when using a custom @accessible directive
0 reputation · 08 Mar 2020, 22:01 UTC
The goal is to determine whether a custom @accessible directive can be used to attach accessibility information (such as ARIA roles or labels) to GraphQL fields and have that information survive introspection and error‑payload generation in Apollo Server 4.
Because the GraphQL specification does not standardize accessibility metadata, servers may ignore unknown directives, and clients may not expose them through introspection. This creates uncertainty about whether the directive will be preserved in __schema, whether tooling like Apollo Studio will surface it, and whether error responses can be extended with accessibility‑focused properties without breaking generic clients.
What behavior does Apollo Server 4 exhibit when a schema includes the @accessible directive? Does the directive appear in introspection results, and can it be leveraged by clients to produce screen‑reader‑friendly UI or error messages?