-
Notifications
You must be signed in to change notification settings - Fork 173
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
GraphQLCodeRegistry.Builder is null in custom SchemaDirectiveWirings #268
Comments
I'm seeing the same issue, but in my case it's on an argument directive. |
The culprit appears to be https://github.com/graphql-java-kickstart/graphql-java-tools/blob/master/src/main/kotlin/graphql/schema/idl/DirectiveBehavior.kt#L58, it explicitly passes |
So, this patch
works around the NPE, but I'm not really sure this is the right solution. I would guess that |
FWIW this is still an issue with 5.6.0 + graphql-java 13.0. |
Code registry builder is now more actively being used by the lib, so should be easy next step to fix this issue now. Will take a look |
Hi,
I recently tried to upgrade to the newest version of this library, (graphql-spring-boot-starter is now
5.8.1
and graphql-java-tools is now5.6.0
both of them seem to be graphql-v12 so I think they should be compatible) and didn't find a solution for the new style of creating directives.Consider this bean in my spring-boot configuration class:
and the respective class:
On application startup I now run into nullpointer exceptions in the line
DataFetcher<?> originalDataFetcher = env.getCodeRegistry().getDataFetcher(parent, field);
becausegetCodeRegistry
returns null.I debugged that now quite a while and the problem seems to be that in
DirectiveBehavior.toParameters
the conversion toSchemaGeneratorDirectiveHelper.Parameters
only stores the runtime wiring, which is ignored while creating theSchemaDirectiveWiringEnvironmentImpl
.A solution could be to unpack the
GraphQLCodeRegistry.Builder
from the runtime-wiring, either at the first conversion from directive behavior parameters to schema generator parameters, or afterwards.Maybe I do also only have to change how the directive is added?
The text was updated successfully, but these errors were encountered: