Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.
This repository was archived by the owner on May 16, 2019. It is now read-only.

Adding Context parameter to resolver causes errors in introspection #47

@mdnorman

Description

@mdnorman

Adding a Context parameter to a resolver seems to work properly during execution, but introspection comes back with an object that fails to be parsed properly by eg GraphiQL.

Example resolver:

mutation("registerAccount") {
  accessRule { ctx ->
    println("rule context: $ctx")
    null
  }

  suspendResolver { ctx: Context, email: String ->
    println("resolver context: $ctx")
    println("email: $email")
  }
}

When executing the function, it does the right thing:

rule context: com.github.pgutkowski.kgraphql.Context@200146c2
resolver context: com.github.pgutkowski.kgraphql.Context@200146c2
email: some-person@example.com

However, GraphiQL gives the following error when introspecting the schema: Error: Unknown type reference: {"kind":"OBJECT","name":null,"ofType":null}

In addition, executing with "extra" parameters shows that ctx is incorrectly included in the parameter list: `registerAccount does support arguments [ctx, email]. Found arguments [accountName, email]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions