Skip to content

Commit

Permalink
emit combined reader AST when flag is enabled
Browse files Browse the repository at this point in the history
Reviewed By: Snowshine-afk

Differential Revision: D49609423

fbshipit-source-id: b2db210bd327b747de796bc04232adb598f7e0ee
  • Loading branch information
Alex Danoff authored and facebook-github-bot committed Oct 9, 2023
1 parent 9311248 commit 5427d69
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,46 @@ extend type Query {
"fragment": {
"argumentDefinitions": [],
"kind": "Fragment",
"metadata": null,
"metadata": {
"hasClientEdges": true
},
"name": "relayResolverWeakObjectNormalizationAstQuery",
"selections": [
{
"kind": "ClientExtension",
"selections": [
{
"alias": null,
"args": null,
"kind": "ClientEdgeToClientObject",
"concreteType": "MyClientType",
"backingField": {
"alias": null,
"args": null,
"fragment": null,
"kind": "RelayResolver",
"name": "client_type",
"resolverModule": require('relay-runtime/experimental').weakObjectWrapper(require('ClientTypeResolver'), '__relay_model_instance', false),
"path": "client_type",
"normalizationInfo": {
"concreteType": "MyClientType",
"kind": "LinkedField",
"name": "client_type",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
}
],
"storageKey": null
"normalizationNode": require('Query__client_type$normalization.graphql')
}
]
},
"linkedField": {
"alias": null,
"args": null,
"concreteType": "MyClientType",
"kind": "LinkedField",
"name": "client_type",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
}
],
"storageKey": null
}
}
],
"type": "Query",
Expand Down
25 changes: 10 additions & 15 deletions compiler/crates/relay-transforms/src/apply_transforms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,22 +252,17 @@ fn apply_reader_transforms(

program = log_event.time("required_directive", || required_directive(&program))?;

if !project_config
.feature_flags
.enable_resolver_normalization_ast
{
program = log_event.time("client_edges", || {
client_edges(&program, project_config, &base_fragment_names)
})?;
program = log_event.time("client_edges", || {
client_edges(&program, project_config, &base_fragment_names)
})?;

program = log_event.time("relay_resolvers", || {
relay_resolvers(
project_config.name,
&program,
project_config.feature_flags.enable_relay_resolver_transform,
)
})?;
}
program = log_event.time("relay_resolvers", || {
relay_resolvers(
project_config.name,
&program,
project_config.feature_flags.enable_relay_resolver_transform,
)
})?;

program = log_event.time("client_extensions", || client_extensions(&program));
program = log_event.time("handle_field_transform", || {
Expand Down

0 comments on commit 5427d69

Please sign in to comment.