{"record":{"id":"54e6ae9b94587c1f","repo":"facebook/relay","slug":"the-argument-in-exec-time-resolvers-directive-s","errorCode":null,"errorMessage":"The {} argument in exec_time_resolvers directive should be the string name of your provider file.","messagePattern":"The (.+?) argument in exec_time_resolvers directive should be the string name of your provider file\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/crates/relay-codegen/src/build_ast.rs","lineNumber":445,"sourceCode":"        //  @exec_time_resolvers but without the exec time provider argument, exec time is enabled by default.\n        // `use_experimental_provider` make the exec time query use the experimental exec time exeuctor in runtime\n        // `use_network_normalization_provider` make the query opt in to the executeWithNetwork coordinated\n        //  publish path at runtime. Used to explicitly route variable-gated S2C queries.\n        let (\n            exec_time_resolvers_enabled_provider,\n            use_experimental_provider,\n            use_network_normalization_provider,\n        ) = if let Some(directive) = operation.directives.named(*EXEC_TIME_RESOLVERS) {\n            let parse_provider_arg = |arg_name: ArgumentName| {\n                directive\n                    .arguments\n                    .named(arg_name)\n                    .map(|arg| match &arg.value.item {\n                        Value::Constant(ConstantValue::String(cons)) => WithLocation {\n                            item: *cons,\n                            location: arg.value.location,\n                        },\n                        _ => panic!(\n                            \"The {} argument in exec_time_resolvers directive should be the string name of your provider file.\",\n                            arg_name.0.lookup()\n                        ),\n                    })\n            };\n            (\n                parse_provider_arg(*EXEC_TIME_RESOLVERS_ENABLED_ARGUMENT),\n                parse_provider_arg(ArgumentName(intern!(\"useExperimentalProvider\"))),\n                parse_provider_arg(ArgumentName(intern!(\"useNetworkNormalizationProvider\"))),\n            )\n        } else {\n            (None, None, None)\n        };\n\n        let mut context = ContextualMetadata {\n            has_client_edges: false,\n            has_client_to_server_resolvers: false,\n            has_exec_time_resolvers_directive,","sourceCodeStart":427,"sourceCodeEnd":463,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/compiler/crates/relay-codegen/src/build_ast.rs#L427-L463","documentation":"When building an operation, the execTimeResolvers (exec_time_resolvers) directive's named argument must be a string naming the runtime resolver provider file. Anything else (non-string constant, variable) hits the panic arm, because codegen needs a literal file name to emit the import.","triggerScenarios":"An operation defines a `... on Query @exec_time_resolvers(...)` style directive whose argument (looked up by arg_name) is not Value::Constant(ConstantValue::String) — e.g. a variable, number, or object — during build_operation.","commonSituations":"Typo or wrong value type in the exec_time_resolvers argument; injecting the provider name via a GraphQL variable; a refactor where the provider name moved into config but the directive still needs a literal string.","solutions":["Set the directive argument to a literal string containing the provider file name, e.g. @exec_time_resolvers(provider: \"MyQueryResolvers\").","Remove the variable and inline the provider name as a quoted string.","Check the directive name/argument spelling matches what the compiler expects for exec_time_resolvers.","Regenerate the operation from the tooling that owns the exec_time_resolvers directive so it emits a string constant."],"exampleFix":"// before\nquery MyQuery @exec_time_resolvers(provider: $file) { ... }\n// after\nquery MyQuery @exec_time_resolvers(provider: \"MyQueryResolvers\") { ... }\n","handlingStrategy":"validation","validationCode":"fn validate_exec_time_resolvers(op: &ExecutableDefinition) -> Result<(), String> {\n    for d in op.directives() {\n        if d.name.item.0.contains(\"exec_time_resolvers\") {\n            for a in &d.arguments {\n                if !matches!(a.value.item, Value::Constant(ConstantValue::String(_))) {\n                    return Err(format!(\"{} must be a string\", a.name.item.0));\n                }\n            }\n        }\n    }\n    Ok(())\n}\n","typeGuard":null,"tryCatchPattern":"let result = std::panic::catch_unwind(|| build_operation(...));\nif result.is_err() { report(\"exec_time_resolvers argument must be a literal string\"); }\n","preventionTips":["Always pass the provider file name as a quoted literal string in exec_time_resolvers.","Never parameterize the directive argument with a variable.","Lint operations for non-string exec_time_resolvers arguments before compiling."],"tags":["graphql","directive","codegen","string-argument"],"backgroundTag":"invalid-directive-argument","analyzedSha":"668b1b85e06261aa3b58dabfc51f8b5524a70955","analyzedAt":"2026-09-02T19:57:20.783Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}