fsprojects / FSharp.Data.GraphQL

FSharp implementation of Facebook GraphQL query language.
http://fsprojects.github.io/FSharp.Data.GraphQL/
MIT License
399 stars 73 forks source link

LHK-590 Added modern GraphQL Relay sample project with React #420

Closed okhorsunenko-lula closed 1 year ago

xperiandri commented 1 year ago

@andriilula please, review too

xperiandri commented 1 year ago

@okhorsunenko-lula, @andriilula do we need relay-starter-kit having relay-modern-starter-kit?

xperiandri commented 1 year ago

@okhorsunenko-lula let's format fields input parameter in the same way across the solution FSharp.Data.GraphQL.Relay/Connections.fs either

fields = [
    Define.Field("hasNextPage", Boolean, "When paginating forwards, are there more items?", fun _ pageInfo -> pageInfo.HasNextPage)
    Define.Field("hasPreviousPage", Boolean, "When paginating backwards, are there more items?", fun _ pageInfo -> pageInfo.HasPreviousPage)
    Define.Field("startCursor", Nullable String, "When paginating backwards, the cursor to continue.", fun _ pageInfo -> pageInfo.StartCursor)
    Define.Field("endCursor", Nullable String, "When paginating forwards, the cursor to continue.", fun _ pageInfo -> pageInfo.EndCursor)
])

or

fields =
    [ Define.Field("hasNextPage", Boolean, "When paginating forwards, are there more items?", fun _ pageInfo -> pageInfo.HasNextPage)
      Define.Field("hasPreviousPage", Boolean, "When paginating backwards, are there more items?", fun _ pageInfo -> pageInfo.HasPreviousPage)
      Define.Field("startCursor", Nullable String, "When paginating backwards, the cursor to continue.", fun _ pageInfo -> pageInfo.StartCursor)
      Define.Field("endCursor", Nullable String, "When paginating forwards, the cursor to continue.", fun _ pageInfo -> pageInfo.EndCursor) ])

What Fantomas will do?

xperiandri commented 1 year ago

@okhorsunenko-lula so will you replace the old Relay folder content with content from the modern Relay?

xperiandri commented 1 year ago

@okhorsunenko-lula test Relay again. I made Edges not nullable. I don't understand why the original author made them nullable. Have you seen anything about that in spec?

xperiandri commented 1 year ago

@okhorsunenko-lula we need to test the sample manually again. Then we can merge

okhorsunenko-lula commented 1 year ago

@xperiandri tested, looks good and works, attaching the screenshot Can you please merge it?

image