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

suppressSwiftMultilineStringLiterals breaks operationIdentifiers for persisted queries #2556

Open
klep opened this issue Feb 1, 2022 · 0 comments

Comments

@klep
Copy link

klep commented Feb 1, 2022

Intended outcome:

The operationId calculated by the server based on the queryDocument of a given operation matches the operationId output by Apollo, even when the classes are generated without multiline String literals.

Actual outcome:

The operationId created by Apollo is calculated when the query contains newlines, which are not included in the queryDocument provided by the generated classes. As a result, the hashes don't match and all query caching fails.

How to reproduce the issue:

  • Specify --suppressSwiftMultilineStringLiterals to Apollo codegen to get classes without multiline strings for queryDocument
  • Specify --operationIdsPath=*** to include SHA-256 hashes of each operation for query caching

Versions

2.33.9

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

1 participant