Automatically encode and decode input arguments?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Esamina l’uso attuale di Define.Input e ResolveFieldContext.TryArg mostrato nell’issue prima di valutare un approccio con argomenti tipizzati. Il lavoro richiederebbe un modo definito per codificare e decodificare un record come CreateUserArgs, dimostrando il completamento tramite l’accesso a fname e lname attraverso il meccanismo proposto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- F#
- Stelle
- 406
- Fork
- 74
- Merge medio
- 1g 8h
- PR unite (30g)
- 14
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fsprojects/FSharp.Data.GraphQL
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
fsprojects/FSharp.Data.GraphQL#573 · 1 reazione · 2 assegnatari ·
-
FR: Suave package Aperta
fsprojects/FSharp.Data.GraphQL#566 · 1 commento · 1 reazione · 2 assegnatari ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
Tutte le issue di fsprojects/FSharp.Data.GraphQL
Issue simili
-
bug priority:normal ready-for-dev
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
OpenHands/extensions#626 · 1 commento ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
avniproject/avni-client#2135 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
use-agent-os/agent-os#3276 ·