ChilliCream / ChilliCream/graphql-platform
Expose a global ID input value conversion hook
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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