Use shared constant
Summary: * use shared constant instead of redefining 2x
use std::collections::HashSet;
use std::sync::Arc;
-use common::ArgumentName;
use common::Diagnostic;
use common::DiagnosticsResult;
use common::NamedItem;
@@ -22,7 +21,6 @@ use graphql_ir::ScalarField;
use graphql_ir::Selection;
use graphql_syntax::OperationKind;
use intern::string_key::Intern;
-use lazy_static::lazy_static;
use relay_config::SchemaConfig;
use schema::Field;
use schema::FieldID;
@@ -35,14 +33,10 @@ use crate::get_normalization_operation_name;
use crate::match_::RawResponseGenerationMode;
use crate::relay_resolvers::get_bool_argument_is_true;
use crate::relay_resolvers::RELAY_RESOLVER_DIRECTIVE_NAME;
+use crate::relay_resolvers::RELAY_RESOLVER_HAS_OUTPUT_TYPE;
use crate::SplitOperationMetadata;
use crate::ValidationMessage;
-lazy_static! {
- pub static ref HAS_OUTPUT_TYPE_ARGUMENT_NAME: ArgumentName =
- ArgumentName("has_output_type".intern());
-}
-
fn generate_fat_selections_from_type(
schema: &SDLSchema,
schema_config: &SchemaConfig,
@@ -294,7 +288,7 @@ pub fn generate_relay_resolvers_operations_for_nested_objects(
if let Some(directive) = field.directives.named(*RELAY_RESOLVER_DIRECTIVE_NAME) {
let has_output_type =
- get_bool_argument_is_true(&directive.arguments, *HAS_OUTPUT_TYPE_ARGUMENT_NAME);
+ get_bool_argument_is_true(&directive.arguments, *RELAY_RESOLVER_HAS_OUTPUT_TYPE);
if !has_output_type {
continue;
}
