Use computation expressions for defining schema
See original GitHub issueWe talked with @johnberzy-bazinga about idea of using cexprs for defining schemas, i.e instead of current:
let Person = Define.Object("Person", "description", [
Define.Field("firstName", String, "Person's first name", fun ctx p -> p.FirstName)
Define.Field("lastName", String, "Person's last name", fun ctx p -> p.LastName)
])
have something like:
let Person = outputObject "Person" {
description "description"
field "firstName" String "Person's first name" [] (fun _ p -> p.FirstName)
field "lastName" String "Person's last name" [] (fun _ p -> p.LastName)
}
This topic is to discuss about that. Is it even possible? Is it feasible?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Computation expressions: Introduction
Computation expressions seem to have a reputation for being abstruse and difficult to understand. On one hand, they're easy enough to use.
Read more >Computation Expressions - F# | Microsoft Learn
You can define the characteristics of your own computation expressions by creating a builder class and defining certain special methods on the ...
Read more >F Sharp Programming/Computation Expressions
Defining Computation Expressions. Computation expressions are fundamentally the same concept as seen above, although they hide the complexity of monadic syntax ...
Read more >Computation Expressions Explained | Step-By-Step Tutorial
... Timestamps: 0:00 Intro 0:10 What are computation expressions 4:10 Tutorial 4:50 Bare minimum definition 6:25 return method 8:32 let ...
Read more >Custom Keywords in Computation Expressions
Computation expressions can be very useful for creating a highly readable, imperative-style chain of instructions. If you design the CE well ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Lenne231 there are several issues with following graphql-js desing:
Have to add that consuming the API in this form:
https://github.com/GT-CHaRM/CHaRM.Backend/blob/master/src/CHaRM.Backend/Schema/Item.fs
makes it much more simpler and easier to implement than the current form.