Eliminated unnecessary list allocations in Validation.fs and migrated to underscore property access lambda syntax#536
Merged
xperiandri merged 2 commits intodevfrom Aug 19, 2025
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes code by eliminating unnecessary list allocations and modernizes F# syntax by migrating from explicit lambda expressions to the more concise underscore property access syntax.
- Replaced array/list creation with sequence operations to avoid intermediate allocations
- Migrated from
fun x -> x.Propertysyntax to_.Propertysyntax throughout the codebase - Updated option handling to use
ValueOptionwhere appropriate for better performance
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/FSharp.Data.GraphQL.Tests/DeferredTests.fs | Updated lambda to underscore syntax for property access |
| tests/FSharp.Data.GraphQL.IntegrationTests/SwapiRemoteProviderTests.fs | Simplified array mapping with underscore syntax |
| src/FSharp.Data.GraphQL.Shared/Validation.fs | Major refactoring: replaced arrays with sequences, migrated lambdas to underscore syntax, updated option handling |
| src/FSharp.Data.GraphQL.Server/Values.fs | Updated array mapping to use underscore syntax |
| src/FSharp.Data.GraphQL.Server/Executor.fs | Simplified middleware function reference with underscore syntax |
| src/FSharp.Data.GraphQL.Server/Execution.fs | Updated option mapping to use underscore syntax |
| src/FSharp.Data.GraphQL.Client/Extensions.fs | Simplified array mapping in MD5 hash computation |
| src/FSharp.Data.GraphQL.Client/BaseTypes.fs | Updated sequence sorting to use underscore syntax |
| src/FSharp.Data.GraphQL.Client.DesignTime/ProvidedTypesHelper.fs | Multiple updates to use underscore syntax and sequence operations |
| src/FSharp.Data.GraphQL.Client.DesignTime/GraphQLProvider.DesignTime.fs | Updated array filtering to use underscore syntax |
| samples/relay-book-store/Schema.fs | Updated option mapping to use underscore syntax |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.