-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow legacy resolvers with @rootFragment on model types
Reviewed By: andreqi Differential Revision: D45456334 fbshipit-source-id: e133da737c83dd9f389254ca7b87e15367cd3854
- Loading branch information
1 parent
af88daf
commit 0fe2553
Showing
8 changed files
with
372 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...block/tests/to_schema/fixtures/legacy-relay-resolver-with-root-fragment-on-model.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
==================================== INPUT ==================================== | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @RelayResolver MyType | ||
*/ | ||
|
||
/** | ||
* @RelayResolver | ||
* @onType MyType | ||
* @fieldName my_field | ||
* @rootFragment myRootFragment | ||
*/ | ||
|
||
graphql` | ||
fragment myRootFragment on MyType { | ||
id | ||
} | ||
` | ||
==================================== OUTPUT =================================== | ||
type MyType @__RelayResolverModel { | ||
id: ID! | ||
__relay_model_instance: Int @relay_resolver(import_path: "/path/to/test/fixture/legacy-relay-resolver-with-root-fragment-on-model.js", fragment_name: "MyType__id", inject_fragment_data: "id", import_name: "MyType") @unselectable(reason: "This field is intended only for Relay's internal use") | ||
} | ||
|
||
|
||
extend type MyType { | ||
my_field: RelayResolverValue @relay_resolver(import_path: "/path/to/test/fixture/legacy-relay-resolver-with-root-fragment-on-model.js", fragment_name: "myRootFragment", import_name: "my_field") | ||
} |
23 changes: 23 additions & 0 deletions
23
...ay-docblock/tests/to_schema/fixtures/legacy-relay-resolver-with-root-fragment-on-model.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @RelayResolver MyType | ||
*/ | ||
|
||
/** | ||
* @RelayResolver | ||
* @onType MyType | ||
* @fieldName my_field | ||
* @rootFragment myRootFragment | ||
*/ | ||
|
||
graphql` | ||
fragment myRootFragment on MyType { | ||
id | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
189 changes: 189 additions & 0 deletions
189
...__tests__/__generated__/RelayResolverModelTestFieldWithRootFragmentLegacyQuery.graphql.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.