|
1 | 1 | use std::sync::Arc; |
2 | 2 |
|
3 | 3 | use graphql_tools::{ |
4 | | - static_graphql::{query::Document as QueryDocument, schema::Document as SchemaDocument}, |
| 4 | + static_graphql::query::Document as QueryDocument, |
5 | 5 | validation::{rules::ValidationRule, utils::ValidationError, validate::ValidationPlan}, |
6 | 6 | }; |
7 | 7 | use hive_router_query_planner::consumer_schema::ConsumerSchema; |
@@ -32,12 +32,8 @@ pub struct OnGraphQLValidationStartHookPayload<'exec> { |
32 | 32 | /// [Learn more about the context data sharing in the docs](https://the-guild.dev/graphql/hive/docs/router/extensibility/plugin_system#context-data-sharing) |
33 | 33 | pub context: &'exec PluginContext, |
34 | 34 | pub request_context: RequestContextApi, |
35 | | - /// The GraphQL Schema that the document will be validated against. |
36 | | - /// This is not the same with the supergraph. This is the public schema exposed by the router to the clients, which is generated from the supergraph and can be modified by the plugins. |
37 | | - /// The plugins can replace the input schema to be used for validation |
38 | | - /// and the new schema will be used in the validation process instead of the original one. |
39 | | - /// |
40 | | - /// [See an example to see when to override the schema](https://github.com/graphql-hive/router/blob/main/plugin_examples/feature_flags/src/plugin.rs) |
| 35 | + /// The GraphQL schema that the document will be validated against. |
| 36 | + /// This is the public schema exposed by the router, not the supergraph. |
41 | 37 | pub schema: Arc<ConsumerSchema>, |
42 | 38 | /// Parsed GraphQL document from the query string in the GraphQL parameters. |
43 | 39 | /// It contains the Abstract Syntax Tree (AST) representation of the GraphQL query, mutation, or subscription |
@@ -70,14 +66,6 @@ impl OnGraphQLValidationStartHookPayload<'_> { |
70 | 66 | self.validation_plan = Arc::new(validation_plan.into()); |
71 | 67 | self |
72 | 68 | } |
73 | | - /// Override the GraphQL Schema that the document will be validated against. |
74 | | - /// [See an example to see when to override the schema](https://github.com/graphql-hive/router/blob/main/plugin_examples/feature_flags/src/plugin.rs) |
75 | | - pub fn with_schema<TSchema: Into<Arc<SchemaDocument>>>(mut self, schema: TSchema) -> Self { |
76 | | - let schema: Arc<SchemaDocument> = schema.into(); |
77 | | - let new_consumer_schema = ConsumerSchema::from(schema); |
78 | | - self.schema = new_consumer_schema.into(); |
79 | | - self |
80 | | - } |
81 | 69 | } |
82 | 70 |
|
83 | 71 | impl<'exec> StartHookPayload<OnGraphQLValidationEndHookPayload, Response> |
|
0 commit comments