Skip to content

Bump version to 3.1.1 and add tests for reserved scalar names handling#550

Open
fwaris wants to merge 2 commits intofsprojects:devfrom
fwaris:dev
Open

Bump version to 3.1.1 and add tests for reserved scalar names handling#550
fwaris wants to merge 2 commits intofsprojects:devfrom
fwaris:dev

Conversation

@fwaris
Copy link
Copy Markdown

@fwaris fwaris commented Apr 3, 2026

Ran into GQL that defines 'Date' as object with two fields.
This is legal GQL but 'Date' is hardcoded to the cli type in the provider.
This PR overrides that restirction, i.e. if there is a conflict with the schema for a type name that is mapped to a known scalar, the schema overrides.
Added new tests. All tests pass.

@xperiandri xperiandri requested a review from Copilot April 3, 2026 22:15
Copy link
Copy Markdown
Collaborator

@xperiandri xperiandri left a comment

Choose a reason for hiding this comment

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

Looks good, just a few minor changes.
Thank you very much for the contribution!

RELEASE_NOTES.md Outdated
Comment on lines +1 to +3
### 3.1.1 - 2026-04-03
* Fixed GraphQL client provider handling for schema types that reuse reserved scalar names such as `Date`, so introspection kind now takes precedence over built-in scalar mappings.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this must go to the bottom of the file

| None when isScalar typeName -> struct (variableName, typeName, typeof<string option>)
| None when TypeMapping.isScalarTypeName schemaTypes typeName -> struct (variableName, typeName, typeof<string option>)
| None ->
match schemaProvidedTypes.TryFind(typeName) with
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
match schemaProvidedTypes.TryFind(typeName) with
match schemaProvidedTypes.TryFind typeName with

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the GraphQL client provider to prefer introspection type kinds over built-in scalar mappings when names conflict (e.g., schema defines Date as an object/input object), and adds regression coverage plus a version bump.

Changes:

  • Adjust scalar/type-name resolution so schema type kinds take precedence over reserved/built-in scalar name mappings.
  • Add integration tests and introspection fixtures covering Date as OBJECT and INPUT_OBJECT.
  • Bump package version to 3.1.1 and update release notes.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/FSharp.Data.GraphQL.IntegrationTests/reserved_scalar_object_date_introspection.json Adds fixture where Date is an OBJECT in the schema
tests/FSharp.Data.GraphQL.IntegrationTests/reserved_scalar_input_date_introspection.json Adds fixture where Date is an INPUT_OBJECT in the schema
tests/FSharp.Data.GraphQL.IntegrationTests/ReservedScalarNameProviderTests.fs Adds regression tests to ensure providers compile with reserved scalar name reuse
tests/FSharp.Data.GraphQL.IntegrationTests/FSharp.Data.GraphQL.IntegrationTests.fsproj Includes new test file and introspection fixtures in the test project
src/FSharp.Data.GraphQL.Client/BaseTypes.fs Introduces helpers to distinguish built-in scalars vs schema-defined scalars and adjusts schema type filtering
src/FSharp.Data.GraphQL.Client.DesignTime/ProvidedTypesHelper.fs Switches operation variable type mapping to use the new scalar/type-name helpers
RELEASE_NOTES.md Adds 3.1.1 release entry, but currently duplicates the 3.1.1 heading
Directory.Build.props Bumps NuGet package version to 3.1.1

RELEASE_NOTES.md Outdated
@@ -1,3 +1,6 @@
### 3.1.1 - 2026-04-03
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

The release notes now contain two separate sections for version 3.1.1 (one dated and one 'Unreleased'), which is confusing and can lead to incorrect changelog generation. Please merge these entries under a single 3.1.1 section, or bump the 'Unreleased' header to the next version (e.g., 3.1.2 - Unreleased) so each version appears only once.

Suggested change
### 3.1.1 - 2026-04-03
### 3.1.2 - Unreleased

Copilot uses AI. Check for mistakes.
RELEASE_NOTES.md Outdated
@@ -242,4 +245,4 @@

### 3.1.1 - Unreleased
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

The release notes now contain two separate sections for version 3.1.1 (one dated and one 'Unreleased'), which is confusing and can lead to incorrect changelog generation. Please merge these entries under a single 3.1.1 section, or bump the 'Unreleased' header to the next version (e.g., 3.1.2 - Unreleased) so each version appears only once.

Suggested change
### 3.1.1 - Unreleased
### 3.1.2 - Unreleased

Copilot uses AI. Check for mistakes.
Comment on lines +45 to +50
true |> equals true

[<Fact>]
let ``Should allow input object types that reuse reserved scalar names`` () =
InputDateSchema.compileSmoke ()
true |> equals true
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

These assertions are no-ops (they always compare true to true) and don’t add signal beyond ‘test did not throw’. Since xUnit will already fail the test on any exception from compileSmoke, consider removing the true |> equals true lines (or replace with an assertion that reflects an observable outcome if you want runtime validation).

Suggested change
true |> equals true
[<Fact>]
let ``Should allow input object types that reuse reserved scalar names`` () =
InputDateSchema.compileSmoke ()
true |> equals true
[<Fact>]
let ``Should allow input object types that reuse reserved scalar names`` () =
InputDateSchema.compileSmoke ()

Copilot uses AI. Check for mistakes.
@xperiandri
Copy link
Copy Markdown
Collaborator

@fwaris could you fix and I will release?

@fwaris
Copy link
Copy Markdown
Author

fwaris commented Apr 6, 2026

addressed comments. thanks.

Copy link
Copy Markdown
Collaborator

@xperiandri xperiandri left a comment

Choose a reason for hiding this comment

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

Both changes will be released

Comment on lines +245 to +248
* Fixed GraphQL client provider handling for schema types that reuse reserved scalar names such as `Date`, so introspection kind now takes precedence over built-in scalar mappings.

### 3.1.2 - Unreleased
* Fixed planning phase crash when inline fragments reference types not included in union or interface definitions
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* Fixed GraphQL client provider handling for schema types that reuse reserved scalar names such as `Date`, so introspection kind now takes precedence over built-in scalar mappings.
### 3.1.2 - Unreleased
* Fixed planning phase crash when inline fragments reference types not included in union or interface definitions
* Fixed planning phase crash when inline fragments reference types not included in union or interface definitions
* Fixed GraphQL client provider handling for schema types that reuse reserved scalar names such as `Date`, so introspection kind now takes precedence over built-in scalar mappings.

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.

3 participants