本文整理了Java中graphql.GraphQL.parseAndValidate()
方法的一些代码示例,展示了GraphQL.parseAndValidate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GraphQL.parseAndValidate()
方法的具体详情如下:
包路径:graphql.GraphQL
类名称:GraphQL
方法名:parseAndValidate
暂无
代码示例来源:origin: graphql-java/graphql-java
private CompletableFuture<ExecutionResult> parseValidateAndExecute(ExecutionInput executionInput, GraphQLSchema graphQLSchema, InstrumentationState instrumentationState) {
AtomicReference<ExecutionInput> executionInputRef = new AtomicReference<>(executionInput);
PreparsedDocumentEntry preparsedDoc = preparsedDocumentProvider.get(executionInput.getQuery(),
transformedQuery -> {
// if they change the original query in the pre-parser, then we want to see it downstream from then on
executionInputRef.set(executionInput.transform(bldr -> bldr.query(transformedQuery)));
return parseAndValidate(executionInputRef, graphQLSchema, instrumentationState);
});
if (preparsedDoc.hasErrors()) {
return CompletableFuture.completedFuture(new ExecutionResultImpl(preparsedDoc.getErrors()));
}
return execute(executionInputRef.get(), preparsedDoc.getDocument(), graphQLSchema, instrumentationState);
}
代码示例来源:origin: com.graphql-java/graphql-java
private CompletableFuture<ExecutionResult> parseValidateAndExecute(ExecutionInput executionInput, GraphQLSchema graphQLSchema, InstrumentationState instrumentationState) {
AtomicReference<ExecutionInput> executionInputRef = new AtomicReference<>(executionInput);
PreparsedDocumentEntry preparsedDoc = preparsedDocumentProvider.get(executionInput.getQuery(),
transformedQuery -> {
// if they change the original query in the pre-parser, then we want to see it downstream from then on
executionInputRef.set(executionInput.transform(bldr -> bldr.query(transformedQuery)));
return parseAndValidate(executionInputRef, graphQLSchema, instrumentationState);
});
if (preparsedDoc.hasErrors()) {
return CompletableFuture.completedFuture(new ExecutionResultImpl(preparsedDoc.getErrors()));
}
return execute(executionInputRef.get(), preparsedDoc.getDocument(), graphQLSchema, instrumentationState);
}
内容来源于网络,如有侵权,请联系作者删除!