作者:慈禧太后她妈_151 | 来源:互联网 | 2022-12-19 13:21
我得到以下内容,似乎无法找到答案.
Error [ValidationError{validatiOnErrorType=FieldUndefined, queryPath=[find_by_id], message=Validation error of type FieldUndefined: Field 'find_by_id' in type 'Query' is undefined @ 'find_by_id', locatiOns=[SourceLocation{line=1, column=2}], description='Field 'find_by_id' in type 'Query' is undefined'}]
我的守则.
询问
@GraphQLQuery(name = "find_by_id")
public Event findById(@GraphQLArgument(name = "id") Long id) {
架构
@EJB
private EventFacade eventFacade; // Normal stateless bean
GraphQLSchema guestSchema = new GraphQLSchemaGenerator()
.withOperationsFromSingleton(eventFacade)
.withValueMapperFactory(new JacksonValueMapperFactory())
.withDefaults()
.generate();
GraphQL graphQL = GraphQL.newGraphQL(guestSchema).build();
要执行的代码
String query = "{find_by_id (id: 1){eventName}}";
ExecutionResult result = graphQL.execute(query);
使用SPQR lib
事件POJO是基本的,eventName为String,抽象(Parent)类为id.实体类位于不同的jar(Entity Jar)中.执行查询和构建模式的代码位于EJB Jar中.
任何我出错的帮助/指示将不胜感激.
UPDATE
创建了一个git问题来帮助解决Git问题