Skip to content

Use [<Struct>] ? optional parameters and voption in Define/DefineRec and the introspection chain - #604

Merged
xperiandri merged 3 commits into
devfrom
struct-optional-params
Sep 19, 2026
Merged

xperiandri merged 3 commits into
devfrom
struct-optional-params

Conversation

@xperiandri

@xperiandri xperiandri commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Converts optional-value plumbing in Define/DefineRec, schema/type-system/introspection, and client metadata from reference option values to struct optional parameters with voption/ValueOption.

Review scope

Please review only optional-parameter and stored optional-value plumbing. All F# partial active-pattern conversions, including the new ValueOption reflection pattern, are isolated in the base PR #610 and should not be reviewed again here.

The previously added middleware/helper optional-parameter changes are intentionally excluded from this PR.

Base active-pattern PR: #610

Verification

  • Main and integration solutions build successfully.
  • Unit tests: 655 passed, 5 skipped.
  • Integration tests: 105 passed.
  • git diff --check is clean.

@xperiandri
xperiandri force-pushed the struct-optional-params branch 2 times, most recently from 098f349 to 5f4eb75 Compare September 15, 2026 22:18
@xperiandri
xperiandri force-pushed the struct-optional-params branch 3 times, most recently from d889e68 to 521be88 Compare September 16, 2026 09:29
@xperiandri
xperiandri force-pushed the struct-optional-params branch from 521be88 to 53e9c4c Compare September 18, 2026 17:01
@xperiandri
xperiandri changed the base branch from task-seq-field to dev September 18, 2026 17:01
@xperiandri
xperiandri force-pushed the struct-optional-params branch from 53e9c4c to ec0ebbc Compare September 18, 2026 17:57
@xperiandri
xperiandri changed the base branch from dev to struct-active-patterns September 18, 2026 17:57
@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown

Test Results

    9 files      9 suites   13m 29s ⏱️
  777 tests   772 ✅  5 💤 0 ❌
2 331 runs  2 316 ✅ 15 💤 0 ❌

Results for commit dc55ad1.

♻️ This comment has been updated with latest results.

@xperiandri
xperiandri force-pushed the struct-active-patterns branch from 31d3b6e to bf8f8f3 Compare September 18, 2026 19:54
@xperiandri
xperiandri force-pushed the struct-optional-params branch from ec0ebbc to 4b599d1 Compare September 18, 2026 19:54
@xperiandri
xperiandri force-pushed the struct-active-patterns branch from 2f5b33c to cbfb9f1 Compare September 18, 2026 21:47
Base automatically changed from struct-active-patterns to dev September 18, 2026 22:28
@xperiandri
xperiandri force-pushed the struct-optional-params branch from 4b599d1 to 758ed1a Compare September 18, 2026 23:26
@xperiandri xperiandri changed the title Use [<Struct>] ? optional parameters and voption in Define/DefineRec and the introspection chain Use [<Struct>] ? optional parameters and voption in Define/DefineRec and the introspection chain Sep 18, 2026
@xperiandri
xperiandri force-pushed the struct-optional-params branch 2 times, most recently from 0134df3 to a9e1bad Compare September 19, 2026 14:00
(cherry picked from commit 4b599d1)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The broad cross-layer optional-value migration warrants final human review.

Review effort: Lite
Findings: None

What changed in this PR

This pull request migrates optional-value plumbing in Define/DefineRec, introspection, execution, and client metadata from reference options to voption/ValueOption.

Changes:

  • Updates schema and type-system optional metadata.
  • Adapts validation, execution, introspection, and client handling.
  • Updates tests and middleware definitions.
File Summary
tests/​FSharp.Data.GraphQL.Tests/​Variables and Inputs/​OptionalsNormalizationTests.ValidString.fs Updates optional-parameter test helpers.
tests/​FSharp.Data.GraphQL.Tests/​AstValidationTests.fs Uses ValueNone for directive descriptions.
src/​FSharp.Data.GraphQL.Shared/​Validation.fs Migrates validation optional values.
src/​FSharp.Data.GraphQL.Shared/​TypeSystem.fs Converts type metadata to voption.
src/​FSharp.Data.GraphQL.Shared/​SchemaDefinitions.fs Updates definitions and optional parameters.
src/​FSharp.Data.GraphQL.Shared/​Introspection.fs Uses struct-nullable introspection fields.
src/​FSharp.Data.GraphQL.Server/​Values.fs Handles value-option input defaults.
src/​FSharp.Data.GraphQL.Server/​Schema.fs Produces voption introspection metadata.
src/​FSharp.Data.GraphQL.Server/​Planning.fs Updates introspection argument definitions.
src/​FSharp.Data.GraphQL.Server/​Linq.fs Resolves optional arguments with ValueOption.
src/​FSharp.Data.GraphQL.Server/​Execution.fs Handles value-option defaults and resolvers.
src/​FSharp.Data.GraphQL.Server.Middleware/​SchemaDefinitions.fs Updates filter metadata.
src/​FSharp.Data.GraphQL.Client/​Serialization.fs Adjusts optional-value serialization.
src/​FSharp.Data.GraphQL.Client/​BaseTypes.fs Handles value-option introspection references.
src/​FSharp.Data.GraphQL.Client.DesignTime/​ProvidedTypesHelper.fs Migrates client metadata and schema traversal.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

config remains a reference optional and should be migrated to a struct optional parameter.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)

Comment thread src/FSharp.Data.GraphQL.Server/Schema.fs Outdated
@xperiandri
xperiandri force-pushed the struct-optional-params branch from dc55ad1 to a3911d7 Compare September 19, 2026 14:51
@xperiandri
xperiandri merged commit 63d1e59 into dev Sep 19, 2026
4 checks passed
@xperiandri
xperiandri deleted the struct-optional-params branch September 19, 2026 14:59
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

Successfully merging this pull request may close these issues.

2 participants