Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically add interfaces when deriving ObjectTypes #460

Open
danestig opened this issue Sep 25, 2019 · 0 comments
Open

Automatically add interfaces when deriving ObjectTypes #460

danestig opened this issue Sep 25, 2019 · 0 comments

Comments

@danestig
Copy link

Would it be possible to let the derive macros automatically add interfaces to objects? In the below example the Foo class extends the trait Bar and there exists an InterfaceType for type Bar. I think the macro should add the interface to the type.

trait Bar
  case class Foo(foo: String) extends Bar

  implicit lazy val BarInterfaceType: InterfaceType[_, Bar] =
    InterfaceType(
      name = "Bar",
      fields = sangria.schema.fields()
    )

  implicit lazy val FooObjectType = deriveObjectType[_, Foo](
    Interfaces(BarInterfaceType)  // Can this part be removed?
  )

I

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant