leangen / graphql-spqr

Build a GraphQL service in seconds
Apache License 2.0
1.09k stars 179 forks source link

Problems with using graphql-java version 17+ #420

Closed sgrannan closed 2 years ago

sgrannan commented 2 years ago

I'm getting a mysterious error when using SPQR in conjunction with a newer version of graphql-java (17.3):

nested exception is java.lang.NoClassDefFoundError: graphql/execution/batched/Batched

Error comes from the schema generation and my code block here:

@Bean @Autowired GraphQL configureGraphQLSchema(final UserService userService) {

    GraphQLSchema schema = new GraphQLSchemaGenerator()
            .withOperationsFromSingleton(userService, UserService.class)
            .withValueMapperFactory(new JacksonValueMapperFactory())
            .generate();

    String schemaFiles = new SchemaPrinter().print(schema);
    LOGGER.info(schemaFiles);

    return GraphQL.newGraphQL(schema).build();
}

Whenever I exclude the newer version of graphql-java and use the version pulled in by SPQR it goes away. Is there any chance this library is still being used and will be upgraded with the latest graphql version? Or is there something else I can do to get around this error and use latest?

Thanks

kaqqao commented 2 years ago

You can not replace the core dependency with an incompatible version and expect things to work. I unfortunately don't have the time to actively maintain SPQR these days. I'm certain I'll eventually pick it up again and bring it up to speed, but can't promise anything... It's a disappointing answer, I know. You can of course try creating a local build and migrating it to the latest graphql-java. I don't expect it to be too hard.

kaqqao commented 2 years ago

.