forked from apollographql/apollo-tooling
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate Swift operation IDs and operation <--> operation ID mapping …
…file (apollographql#147) * Initial progress on Swift operationId generation * Add dependency on crypto library for SHA256 * In Swift, operationId is computed and output with every operation class * Factor out Swift operationId into its own function * Write to a JSON file the mapping between operations and their ids (Swift-only) * Update operationIds map to be keyed by operation name (which are guaranteed by apollo-codegen to be unique) and providing values with both operation id and source * OperationIds map is keyed by id, and operation name is part of the value * Use === instead of == * Update Swift Jest snapshots with new newline * Fix missing comma * Add fragments to classDeclarationForOperation invocation in Swift tests * Add unit tests exercising operation id generation in Swift * Move generation of operation IDs and operation source + fragments to compilation step rather than code generation step. Also, when generating operation source + fragments, handle possibility of nested fragment references. * Remove obsolete test checking for generated mapping between operation ids and sources on context (it's no longer done that way) * Improve readability of generateOperationIds option in compileFromSource function in Swif tests * Add Swift code generation test that verifies that, when there are nested fragment refrences, the correct source + fragments is generated for the operation id mapping file * Fix typescript error related to operation ids map * PR feedback and tweaks: - Improve CLI message - Remove unnecessary parameter in a function call - Rename Swift operationId to operationIdentifier * Update test snapshot
- Loading branch information
Showing
7 changed files
with
360 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.