apollographql / apollo-tooling

✏️ Apollo CLI for client tooling (Mostly replaced by Rover)
https://apollographql.com
MIT License
3.04k stars 467 forks source link

suppressSwiftMultilineStringLiterals breaks operationIdentifiers for persisted queries #2556

Open klep opened 2 years ago

klep commented 2 years ago

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:

Versions

2.33.9