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

Strip Operations from Fragments rather then Erroring #236

Open
dleavitt opened this issue Jul 2, 2020 · 0 comments
Open

Strip Operations from Fragments rather then Erroring #236

dleavitt opened this issue Jul 2, 2020 · 0 comments
Labels
core Feature requests related to core functionality project-apollo-client (legacy) LEGACY TAG DO NOT USE

Comments

@dleavitt
Copy link

dleavitt commented Jul 2, 2020

Currently, passing a DocumentNode containing operations to readFragment throws an error:

No operations are allowed when using a fragment as a query. Only fragments are allowed.

https://github.com/apollographql/apollo-client/blob/master/src/utilities/graphql/fragments.ts#L44-L51

Could existing operations in the DocumentNode just be stripped out instead? The current behavior is very inconvenient if your fragments are defined in .graphql files (via the webpack loader or similar) where the fragment definitions aren't available to Javascript except as part of an operation DocumentNode.

@jpvajda jpvajda added the project-apollo-client (legacy) LEGACY TAG DO NOT USE label Aug 24, 2022
@jerelmiller jerelmiller added the core Feature requests related to core functionality label Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Feature requests related to core functionality project-apollo-client (legacy) LEGACY TAG DO NOT USE
Projects
None yet
Development

No branches or pull requests

3 participants