public class GraphQLExecutor extends Object
GraphQLSchema from a JPA EntityManager. The executor
uses the constructed schema to execute queries directly from the JPA data source.
If the executor is given a mutator function, it is feasible to manipulate the GraphQLSchema, introducing
the option to add mutations, subscriptions etc.
| 限定符 | 构造器和说明 |
|---|---|
protected |
GraphQLExecutor() |
|
GraphQLExecutor(MetaDataService metaDataService,
com.centit.support.database.utils.DataSourceDescription databaseId)
Creates a read-only GraphQLExecutor using the entities discovered from the given
EntityManager. |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
createGraphQL() |
graphql.ExecutionResult |
execute(String query) |
graphql.ExecutionResult |
execute(String query,
Map<String,Object> arguments) |
graphql.schema.GraphQLSchema.Builder |
getBuilder()
Gets the builder that was used to create the Schema that this executor is basing its query executions on.
|
graphql.schema.GraphQLSchema |
getGraphQLSchema() |
graphql.schema.GraphQLSchema |
getSchema()
Returns the schema that this executor bases its queries on.
|
GraphQLExecutor |
updateSchema(graphql.schema.GraphQLSchema.Builder builder)
Uses the given builder to re-create and replace the
GraphQLSchema
that this executor uses to execute its queries. |
protected GraphQLExecutor()
public GraphQLExecutor(MetaDataService metaDataService, com.centit.support.database.utils.DataSourceDescription databaseId)
EntityManager.metaDataService - 元数据服务.databaseId - 数据库id@PostConstruct protected void createGraphQL()
public graphql.schema.GraphQLSchema getGraphQLSchema()
GraphQLSchema used by this executor.@Transactional public graphql.ExecutionResult execute(String query)
@Transactional public graphql.ExecutionResult execute(String query, Map<String,Object> arguments)
public graphql.schema.GraphQLSchema.Builder getBuilder()
updateSchema(GraphQLSchema.Builder) method.public graphql.schema.GraphQLSchema getSchema()
GraphQLSchema.public GraphQLExecutor updateSchema(graphql.schema.GraphQLSchema.Builder builder)
GraphQLSchema
that this executor uses to execute its queries.builder - The builder to recreate the current GraphQLSchema and GraphQL instances.GraphQL schema.Copyright © 2020 Centit Information Technical, co. Inc.. All rights reserved.