Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

env.getCodeRegistry() is null #255

Closed
apollo7733 opened this issue Jun 6, 2019 · 2 comments
Closed

env.getCodeRegistry() is null #255

apollo7733 opened this issue Jun 6, 2019 · 2 comments
Labels
Milestone

Comments

@apollo7733
Copy link

@Override
  public GraphQLFieldDefinition onField(SchemaDirectiveWiringEnvironment<GraphQLFieldDefinition> env) {
	System.err.println(env.getCodeRegistry());
	return env.getElement();
  }

// to be removed in a future version when all code is in the code registry
DataFetcher getDataFetcher() {
    return dataFetcherFactory.get(newDataFetchingFactoryEnvironment()
            .fieldDefinition(this)
            .build());
}

but env.getCodeRegistry() is null in SchemaDirectiveWiring

@oliemansm
Copy link
Member

In graphql-java-tools version 5.6.1 the CodeRegistry is now passed on when constructing custom directives. Can you check whether that indeed solves this problem for you?

@oliemansm oliemansm added the bug label Jun 19, 2019
@oliemansm oliemansm added this to the 5.9.1 milestone Jun 20, 2019
@oliemansm
Copy link
Member

Just verified that with 5.9.1 this is indeed resolved. See the updated sample for directives as well: https://github.com/graphql-java-kickstart/samples/blob/master/directives/src/main/java/directives/UppercaseDirective.java.

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

No branches or pull requests

2 participants