ChilliCream / ChilliCream/graphql-platform

Expose a global ID input value conversion hook

Open
#9,670 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ hot chocolate
Dominant language
C#
Stars
5.8k
Forks
810
Avg merge
15h 39m
Merged PRs (30d)
98

Description

Product

Hot Chocolate

Is your feature request related to a problem?

FSharp.HotChocolate provides F# support for Hot Chocolate. It needs to support global ID input values where the target CLR element type is an F# option wrapper.

Minimal example:

[<ID>] X: string option array

The GraphQL input shape is [ID]!, but the CLR array element type is FSharpOption<string>. After Hot Chocolate parses a global ID to string, FSharp.HotChocolate needs to wrap it as Some string before assignment.

I do not see a supported public hook for this. The workaround would be to reflect over or replace GlobalIdInputValueFormatter, which would depend on Hot Chocolate internals.

The solution you'd like

Expose a small public extension point around global ID input formatting so integration packages can adapt parsed ID values to the target CLR runtime shape.

A simple shape could be one of:

  • allow decorating/replacing the generated global ID input formatter for an argument/input field
  • expose a post-parse conversion callback with the parsed ID value and target runtime/element type
  • make the global ID input formatter factory customizable through public configuration

FSharp.HotChocolate would implement the F# conversion itself. The request is only for a supported Hot Chocolate hook, not for Hot Chocolate to implement F# support.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the GlobalIdInputValueFormatter and the global ID input formatter factory mentioned in the issue. Compare the proposed public extension shapes and determine which can support FSharp.HotChocolate without relying on Hot Chocolate internals. Done means a supported public hook is defined and usable for converting parsed IDs to the target runtime type.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, fsharp
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.