GraphQLWebAutoConfiguration:GraphQL的Servlet配置类:
1. 通过GraphQLServletProperties配置 servlet。
Spring boot 配置前缀:?graphql.servlet
配置属性包括:
?
class="java" name="code">private boolean enabled = true; //是否可用 private boolean corsEnabled = true; //是否跨域 private String mapping = "/graphql"; //GraphQL 前端访问网址,可以通过**配置宽域 private boolean exceptionHandlersEnabled = false; private long subscriptionTimeout = 0; private ContextSetting contextSetting = ContextSetting.PER_QUERY_WITH_INSTRUMENTATION; private long asyncTimeout = 30000; private String tracingEnabled = "false"; private boolean actuatorMetrics; private Integer maxQueryComplexity; private Integer maxQueryDepth;
GraphQLJavaToolsAutoConfiguration :GraphQL的Schema配置类:
?
2. 通过GraphQLToolsProperties配置
Spring boot 配置前缀:?graphql.tools
配置属性包括:
?
private String schemaLocationPattern = "**/*.graphqls"; /** * Enable or disable the introspection query. Disabling it puts your server in contravention of * the GraphQL specification and expectations of most clients, so use this option with caution */ private boolean introspectionEnabled = true; private boolean useDefaultObjectmapper = true;
?构建
?
?
?
?
?
?