Automatically encode and decode input arguments?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Review the current Define.Input and ResolveFieldContext.TryArg usage shown in the issue before assessing a typed argument approach. The work would need a defined way to encode and decode a record such as CreateUserArgs, with completion demonstrated by accessing fname and lname through the proposed mechanism.
Written by the indexing model from the issue text.
Description
Looking quickly at how to accept incoming params, is there a current way that allows defining something more global. Currently that's how it's done:
let createUserArgs: InputFieldDef list =
[ Define.Input("fname", String); Define.Input("lname", String); ]
let createUser(ctx: ResolveFieldContext) =
let name = ctx.TryArg("fname")
match name with
| Some n ->
// ok...
| None ->
// failhere...
Now I was wondering if there is another way say we could have something like this which could potentially automatically encode the input params and decode them as well ? Something like this perhaps:
type CreateUserArgs = {
fname: string
lname: string
}
let createUser(ctx: ResolveFieldContext) =
let allArgsInput = ctx.getAllArgs<CreateUserArgs >()
// At this point the system would know about allArgsInput.fname and allArgsInput.lname
- Dominant language
- F#
- Stars
- 406
- Forks
- 74
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 14
Contributor guide
No contributing guide indexed for this repository
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.
More from fsprojects/FSharp.Data.GraphQL
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
fsprojects/FSharp.Data.GraphQL#573 · 1 reaction · 2 assignees ·
-
FR: Suave package Open
fsprojects/FSharp.Data.GraphQL#566 · 1 comment · 1 reaction · 2 assignees ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
All issues in fsprojects/FSharp.Data.GraphQL
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
avniproject/avni-client#2135 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
good first issue refactor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100