Skip to content

Commit

Permalink
update fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
edvinerikson authored and captbaritone committed Jan 23, 2025
1 parent 8633085 commit b1c64f0
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 65 deletions.
12 changes: 12 additions & 0 deletions compiler/crates/relay-compiler/relay-compiler-config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,7 @@
"streamName": "stream",
"useCustomizedBatchArg": "useCustomizedBatch"
},
"enableTokenField": false,
"nodeInterfaceIdField": "id",
"nodeInterfaceIdVariableName": "id",
"nonNodeIdFields": null,
Expand Down Expand Up @@ -1946,6 +1947,11 @@
},
"additionalProperties": false
},
"enableTokenField": {
"description": "If we should select __token field on fetchable types",
"default": false,
"type": "boolean"
},
"nodeInterfaceIdField": {
"description": "The name of the `id` field that exists on the `Node` interface.",
"default": "id",
Expand Down Expand Up @@ -5486,6 +5492,7 @@
"streamName": "stream",
"useCustomizedBatchArg": "useCustomizedBatch"
},
"enableTokenField": false,
"nodeInterfaceIdField": "id",
"nodeInterfaceIdVariableName": "id",
"nonNodeIdFields": null,
Expand Down Expand Up @@ -5587,6 +5594,11 @@
},
"additionalProperties": false
},
"enableTokenField": {
"description": "If we should select __token field on fetchable types",
"default": false,
"type": "boolean"
},
"nodeInterfaceIdField": {
"description": "The name of the `id` field that exists on the `Node` interface.",
"default": "id",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@ fragment refetchableFragmentOnNodeAndFetchableArg_RefetchableFragment on Fetchab
"kind": "ScalarField",
"name": "fetch_id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__token",
"storageKey": null
}
],
"storageKey": null
Expand Down Expand Up @@ -119,7 +112,6 @@ query RefetchableFragmentQuery(
fragment refetchableFragmentOnNodeAndFetchableArg_RefetchableFragment on FetchableType {
id
fetch_id
__token
}


Expand Down Expand Up @@ -154,13 +146,6 @@ fragment refetchableFragmentOnNodeAndFetchableArg_RefetchableFragment on Fetchab
"kind": "ScalarField",
"name": "fetch_id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__token",
"storageKey": null
}
],
"type": "FetchableType",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,6 @@ fragment refetchableFragmentOnNodeAndFetchable_RefetchableFragment on FetchableT
"kind": "ScalarField",
"name": "fetch_id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__token",
"storageKey": null
}
],
"storageKey": null
Expand Down Expand Up @@ -121,7 +114,6 @@ query RefetchableFragmentQuery(
fragment refetchableFragmentOnNodeAndFetchable_RefetchableFragment on FetchableType {
id
fetch_id
__token
}


Expand Down Expand Up @@ -156,13 +148,6 @@ fragment refetchableFragmentOnNodeAndFetchable_RefetchableFragment on FetchableT
"kind": "ScalarField",
"name": "fetch_id",
"storageKey": null
},
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__token",
"storageKey": null
}
],
"type": "FetchableType",
Expand Down
20 changes: 13 additions & 7 deletions compiler/crates/relay-transforms/tests/refetchable_fragment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use fixture_tests::Fixture;
use graphql_test_helpers::apply_transform_for_test;
use relay_config::DeferStreamInterface;
use relay_config::ProjectConfig;
use relay_transforms::transform_connections;
use relay_transforms::transform_refetchable_fragment;
use relay_transforms::ConnectionInterface;
Expand All @@ -21,12 +22,17 @@ pub async fn transform_fixture(fixture: &Fixture<'_>) -> Result<String, String>
false,
);
let base_fragments = Default::default();
transform_refetchable_fragment(
&program,
&Default::default(),
&base_fragments,
false,
vec![],
)
let schema_config = if fixture.content.contains("// enable-token-field: true") {
let mut schema_config: relay_config::SchemaConfig = Default::default();
schema_config.enable_token_field = true;
schema_config
} else {
Default::default()
};
let project_config = ProjectConfig {
schema_config,
..Default::default()
};
transform_refetchable_fragment(&program, &project_config, &base_fragments, false, vec![])
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ fragment RefetchableFragment on NonNodeStory @refetchable(queryName: "Refetchabl
# identifier_query_variable_name: "id",
# },
# ),
# is_prefetchable_pagination: false,
# }
{
actor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,4 @@ fragment RefetchableFragmentFoo on RefetchableInterfaceFoo @refetchable(queryNam
# }
{
id
__token
}
27 changes: 0 additions & 27 deletions compiler/crates/relay-transforms/tests/refetchable_fragment/mod.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
<<<<<<< HEAD
* @generated SignedSource<<733f08cd406c19e1403b12a718566e81>>
=======
* @generated SignedSource<<f2a33e9f40621feaf83bba7d98a60d9b>>
>>>>>>> 7e5452881068 (update fixtures)
*/

mod refetchable_fragment;
Expand Down

0 comments on commit b1c64f0

Please sign in to comment.