Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[typescript-operations] Provide compatibility with Apollo Client data masking feature #10162

Open
jerelmiller opened this issue Oct 4, 2024 · 0 comments

Comments

@jerelmiller
Copy link
Contributor

Is your feature request related to a problem? Please describe.

We are adding data masking to Apollo Client that will mask fragments in the result. To achieve the TypeScript end of this, we are utilizing GraphQL Codegen's fragment masking output generated by passing inlineFragmentTypes: "mask" in the codegen config.

What is currently missing is support for the @unmask directive we are adding as a part of this feature. We are adding this both to provide a migration path for existing Apollo Client users, and provide an escape hatch in situations where you might want to interact with the full result. We would like fragments marked with @unmask to be available in the parent type rather than stripped away as these fields will be available at runtime.

Describe the solution you'd like

We'd like the typescript-operations plugin mask mode to keep fields in fragments marked with @unmask.

Describe alternatives you've considered

We could provide our own maintained GraphQL Codegen plugin, but it would have to be a replacement for typescript-operations and we'd rather get this into core. The request is to add a tiny piece to the existing functionality.

Any additional important details?

See the data masking RFC for more details on the feature in Apollo Client. My alpha announcement comment especially has some more details in regards to how we plan to utilize the TypeScript output from typescript-operations in Apollo Client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@jerelmiller and others