Skip to content

Deriving query code from type #66

Description

@CGenie

Hello,

Suppose I have a type

newtype User = 
  { id :: Int
  , name  :: String
}

Is it possible to automatically create a "full" query for it? I.e I don't want to type

type UserGQL =
  { id :: Int
  , name :: String
  }

and then create a schema out of it, and then remap the UserGQL from the response but just directly define User in schema and have it automatically generate all fields for the query?

Just a note: my model is more complex, with complex types inside of it. On the Haskell side I'm able to derive the deeply nested models structure via the Morpheus library without hand-writing anything.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions