question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Field list is empty" when only using @GraphQLField via deriveContextObjectType

See original GitHub issue

Example:

trait Query {
  val db: Our.Db
  import db._

  @GraphQLField
  def allUsers: Seq[User] = db.run(quote(query[User]))
}

object Query {
  case class Ctx(query: Query)
  implicit val UserOutType = deriveObjectType[Ctx, User]()
  implicit val queryType = deriveContextObjectType[Ctx, Query, Unit](_.query)
  val schema = Schema(queryType)
}

This works just fine if I use:

implicit val queryType =
  deriveContextObjectType[Ctx, Query, Unit](_.query, IncludeMethods("allUsers"))

I’ve tried reading over the macro a time or two but the cause doesn’t jump out at me.

Any ideas?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
mielientievcommented, Aug 4, 2017

Have the same issue. Scala 2.12.3. Sangria 1.2.2

2reactions
pahomovdacommented, Mar 6, 2017

interesting fact: looks like annotation with parameters like @GraphQLTags(...) is never missed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using nullability in GraphQL
In the following schema, we have a Restaurant type with a location field that refers to a Location type: type Restaurant { name:...
Read more >
Class: GraphQL::Schema::Field
Create a field instance from a list of arguments, keyword arguments, and a block. ... The Resolver this field was derived from, if...
Read more >
"Derived" field resolver for GraphQL using Hot Chocolate and ...
The FullName field does show up in the GraphQL query but it is always blank. I think the Employee instance e that is...
Read more >
Execution - GraphQL Java
To execute a query against a schema, build a new GraphQL object with the ... the field's parent object, the query root object...
Read more >
ObjectType - Graphene-Python
GraphQL Argument defaults¶ ... If you define an argument for a field that is not required (and in a query execution it is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found