FSharp.Data.GraphQL icon indicating copy to clipboard operation
FSharp.Data.GraphQL copied to clipboard

Added `FieldDef<'Val, 'Res>` to support resolver changing middlewares

Open xperiandri opened this issue 2 years ago • 2 comments

In order to call Define.Field<'Val>(....).WithAuthorizationPolicy("policy") I need to know not only 'Res which is an object on which FieldDef<'Res> is defined but also a 'Val which is a field type. However when I introduced FieldDef<'Val, 'Res> F# cannot determine the override between Define.Object that gets a list of field and a labmda that return a list of fields. So I had to rename Define.Object overrie to Define.ObjectRec and Define.Interface override to Define.ObjectRec. I have not renamed Define.InputObject as it accepts a parameter of list of another interface

xperiandri avatar Oct 17 '23 22:10 xperiandri

I'm afraid this one may be beyond my skill to review. I'm not sure what the long-term consequences of changing Object to ObjectRec would be.

GBirkel avatar Oct 17 '23 22:10 GBirkel

Anyway we do breaking changes in v2.0 So the main difference is that you need to call Define.ObjectRec to define recursive GraphQL type definitions. Also there is a question if need to rename Define.InputObject override to Define.InputObjectRec to be consistent or leave it as is to be simple?

xperiandri avatar Oct 17 '23 22:10 xperiandri